I created a content type called "Theme" and gave it a machine readable name of "theme". When I clicked on Create Content -> Theme I got this error:
Fatal error: Cannot unset string offsets in .../public_html/includes/form.inc on line 319
Luckily this was a brand new install so I disabled and uninstalled every module that didn't come installed by default. I still got the error. I found out that when I changed the machine readable name of the content type to anything but "theme", the error went away. It's a pretty minor issue, but I thought it was worth fixing.
My system stats:
Linux OS
Drupal 5.5
PHP 5.2.4
MySQLi 4.1.22
Comments
Comment #1
archard commentedComment #2
chx commentedI am fairly sure you can screw up with even more interesting content type names.
Comment #3
panchochx: That makes it worse not better.
Should imho be generically fixed at least for D6, so we don't get code-data conflicts like this again and again in subsequent API changes.
Comment #4
traxer commentedThe fault is with the node system. The documentation for
drupal_get_form()saysThe node system cannot ignore that.
The patch changes the
form_ids of node forms to'node_' . $type . '_node_form'. This is only a temporary solution. Potentially conflicting functions do not exist in core, they can only come from contrib modules (which is an improvement).Comment #5
chx commentedNo way this can happen for Drupal 6...
Comment #6
traxer commentedWhere do you see problems with the patch?
"Theme" is not that far fetched a name for a node type; think of theme gallaries. This issue is even on the edge of being critical; it should definitly be fixed. Do you know of any contrib modules that get broken by the patch?
Comment #7
traxer commentedComment #8
pwolanin commentedseems to be more or less the same issue as: http://drupal.org/node/204415
Comment #9
traxer commentedIt is not.
Comment #10
traxer commentedI marked this as critical. Reasons are
hook_form_alter()as the main reason for my patch to be regarded as an API change. Howeverhook_form_alter()suggests$form['#node']->typeto check the type of the nodenode_forms()does not guarantee a specific value of the$form_idparameter,$form['#id'] == 'node-form'in any case.Comment #11
moshe weitzman commentedCritical is when many people's sites are broken. This affects few people and the site is site is still operational.
Comment #12
pwolanin commentedAn earlier patch proposed at http://drupal.org/node/204415 (wisely by chx) would blacklist "theme" as a content-type.
That's why I linked ot it.
Comment #13
gábor hojtsyIndeed, we can blacklist some types for now, and postpone any API changes to Drupal 7.
Moving the discussion to http://drupal.org/node/204415
Comment #14
lilou commented#204415: Creating content types 'add', 'theme', 'list' (and possibly others) causes various problems is fixed.