简体   繁体   English

Drupal:数据库中的内容类型不在Structure> Content types中的内容类型列表中

[英]Drupal: Content type in database not in the list of content types in Structure>Content types

A while ago I created two content types: 'protocol' and 'protocol2' They were a little different and I wasn't yet sure of which one suited my purposes best, so I tried out both and created some content of each. 不久之前我创建了两种内容类型:'protocol'和'protocol2'它们有点不同,我还不确定哪一种最适合我的目的,所以我尝试了两种内容,并创建了每种内容。 After a bit of testing I concluded that 'protocol2' was the one I was gonna use and that I wanted it to be called 'protocol' and not 'protocol2'. 经过一些测试后我得出结论,'protocol2'是我要使用的那个,我希望它被称为'protocol'而不是'protocol2'。 But I wanted to save the other version of the protocol content type so I taught I would simply swich their names. 但我想保存协议内容类型的其他版本,所以我教过我会简单地改变他们的名字。

So I tried swiching their names, but during this process something went wrong with the 'protocol2' content type that I wanted to use and it just disappeared. 所以我试着改变他们的名字,但在这个过程中,我想要使用的'protocol2'内容类型出了问题,它就消失了。 Or so I taught. 或者我教过。 Anyway I renamed 'protocol' to 'protocol1'(Name and Machine name). 无论如何,我将'protocol'重命名为'protocol1'(名称和机器名称)。 And recreated the one that disappeared. 并重新创造了消失的那个。 I gave it the name Protocol and tried to give it the machine name 'protocol' but this didn't work so I ended up having to name it protocol2 again. 我给它起了名称Protocol并试图给它机器名称'protocol',但是这不起作用所以我最终不得不再将它命名为protocol2。

I have now discovered that there is in the node_type table in the database actually a content type with the machine name 'protocol' which doesn't show up when I look in Structure>Content types on the page. 我现在发现数据库中的node_type表实际上是一个内容类型,其机器名称为'protocol',当我查看页面上的Structure> Content types时,它不显示。 Can I simply clear it from that table or is there some other more propper way to do it? 我可以简单地从该表中清除它还是还有其他更适合的方法来执行此操作?

I have been using Organic groups, and had content type of type 'protocol' or 'protocol2' associated with some groups(I don't remember which). 我一直在使用有机组,并且具有与某些组相关联的“协议”或“协议2”类型的内容类型(我不记得哪些)。 And I think it's screwing up one of the views on the group page. 而且我认为它搞砸了群组页面上的一个观点。 The list with the heading "Publish content to group" consist of "Post" and an empty list element. 标题为“将内容发布到组”的列表由“发布”和空列表元素组成。 Where can I control this list? 我在哪里可以控制这个清单? Isn't this supposed to be a view? 这不应该是一个观点吗?

In the node_type table, make sure locked is 0 and disabled is 0 for all your "protocol" types. node_type表中,确保已locked为0,并且对于所有“协议”类型, disabled为0。 Change all their orig_type values to match their current type values. 更改其所有orig_type值以匹配其当前type值。 Clear the Drupal cache in admin/config/development/performance . 清除admin/config/development/performance的Drupal缓存。

They should all now appear in your "Content types" list and you can work from there. 它们现在应该都出现在“内容类型”列表中,您可以从那里开始工作。

This is an active bug for Drupal 8, with the possibility of any patch being backported, under Drupal issue 515454 . 这是Drupal 8的一个活跃的bug,可能会在Drupal问题515454下向后移植任何补丁。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM