This is a sub-part of the larger patch proposed and already reviewed here: http://drupal.org/node/88633
The current code in function node_type_reset incorrectly assumes that the 'module' element of a node type will correspond to the module name. This is not true- the 'module' element can be defined arbitrarily, especially for modules that define multiple node types (see: http://drupal.org/node/64279#node-types).
Attached patch solves the bug in the simplest way by getting node info from all enabled modules.
Also, I think the type should be set before getting the defaults- reordered these two lines.
patch tested with 5.xRC1+ (current HEAD).
Comments
Comment #1
Jaza commentedwhy has the line
$info = _node_type_set_defaults($info_array[$type->orig_type]);been moved below the line$info['type'] = $type->orig_type;? The line$info['type'] = $type->orig_type;is now useless, as$infowill now be overwritten on the next line. Either remove this line, or restore the two lines to their original order.Other than that, looks good.
Comment #2
pwolanin commented@Jaza- from looking at the code in the 'defaults' function, it seemed to me that it should go first.
Perhaps I need a better test- most module defined types have their 'type' locked, so the positioning of that line make no difference.
Comment #3
pwolanin commentedOk, per Jaza's comment, this patch is now just a change to the one line. I tested the patch, and this one line change does enable the resetting of node types where the 'module' field is not the same as the name of the module.
Comment #4
drummCommitted to HEAD.
Comment #5
(not verified) commented