Drupal: Content type in database not in the list o

2019-06-24 12:01发布

问题:

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. 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'. 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. Or so I taught. Anyway I renamed 'protocol' to 'protocol1'(Name and Machine name). 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.

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. 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). 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?

回答1:

In the node_type table, make sure locked is 0 and disabled is 0 for all your "protocol" types. Change all their orig_type values to match their current type values. Clear the Drupal cache in admin/config/development/performance.

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