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

linulo’s picture

My 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().

linulo’s picture

I 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:

  • Install Drupal 7.0 beta 2.
  • Activate blog and poll modules.
  • Go to admin/structure/types/manage/blog and change the Title field label, save.
  • Either return to the Blog entry content type form or to node/add/blog. The label will be reset to "Title".

Any ideas?

linulo’s picture

Issue tags: +poll
linulo’s picture

Status: Active » Needs review
Issue tags: -poll
StatusFileSize
new768 bytes

I 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.

Status: Needs review » Needs work

The last submitted patch, 951878_content_type_title.patch, failed testing.

linulo’s picture

Status: Needs work » Needs review
StatusFileSize
new755 bytes

*sigh*

valthebald’s picture