What I did:
- Installed 7.0 beta 1 with German localization
- Activated blog module
- Updated to 7.0 beta 2, ran update.php
- Went to admin/structure/types/manage/blog, changed the field labeled Title field label and hit Save content type
Expected result: When creating a new blog entry via node/add/blog the title field should be labeled as edited above.
The result I get: The field is still labeled "Title". However the changed label is saved in the database (table: node_type, row: "blog", column: "title_label").
I will try to narrow it down. Could somebody in the meantime try to confirm this behaviour? Thank you.
Additional observations: The database entry for the blog content type looks strange.
| type |
blog |
| name |
Blogeintrag |
| base |
blog |
| module |
blog |
| description |
Für Blogs mit mehreren Benutzern. Jeder Benutzer erhält einen persönlichen Blog. |
| help |
|
| has_title |
1 |
| title_label |
My Title |
| custom |
0 |
| modified |
1 |
| locked |
1 |
| disabled |
1 |
| orig_type |
blog |
Why is it disabled even when the blog module is activated?
Comments
Comment #1
linulo commentedMy debugging skills are a little rusty, but there seems to be a bug in node.module. Somehow node_type_save() gets called twice on the blog content type, the first time with disabled being 0 and the second time with disabled_changed and disabled set to 1 which I believe to be an error. This second database update is triggered by node_types_rebuild().
Comment #2
linulo commentedI can reproduce this bug with a vanilla 7.0 beta 2 (minimal, English) install, but only if the poll module is activated as well. So the new recipe for reproducing the bug is:
Any ideas?
Comment #3
linulo commentedComment #4
linulo commentedI think I found it. There is a check in node.module, _node_types_build() for disabled modules, but it checks a variable ($info_array) that can long be overwritten with other data which is bound to happen if you have more than one module activated that implements hook_node_info.
If I understand the code correctly, we just need a better check whether a module implementing a content type is active or not. I suggest to check for the name field of the hook_node_info's return value, because it is a required field since Drupal 5.0.
Here is my attempt for a patch. It seems to solve the problem but I do not claim to understand exactly what happens in node.module, so please review critically.
Comment #6
linulo commented*sigh*
Comment #7
valthebaldI believe issue is fixed by #986296: _node_types_build() accidentally marks node types as disabled and #895014: All fields of a node type are lost on module disable