These are three small improvements within one patch.
1. Drupal 5.0 can rename and delete content types. When it does so, also rename or delete the maximum population variables.
2. When coming from Drupal 4.7, those variables are named "nodefamily_typename_max". Drupal 5 has changed the storage format of form elements, so that it always appends "_typename" to any node setting variable. The port to Drupal 5.0 changed this appropriately, but didn't rename the variables when coming from a previous install. So, introduce version management and provide an upgrade function.
3. I missed this in the 5.0 port: the '#options' field of the Child and Parent Node ID in nodefamily_views_tables() used node_get_types() which now returns an array of objects instead of a string array. The '#options' field needs to keep the old format though, so factor the _nodeprofile_get_typenames() function out and use it there.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | nodefamily_update_relations.patch | 6.02 KB | jpetso |
| #2 | nodefamily_handle_updates_try2.patch | 5 KB | jpetso |
| nodefamily_handle_updates.patch | 3.94 KB | jpetso |
Comments
Comment #1
fagogreat improvements!
However couldn't we use node_get_types('names') ?
Comment #2
jpetso commentedAh, so that's what $node_names are supposed to be. Makes sense.
Here's the rerolled version of the patch, with that in mind. Additionally, it also deletes the nodefamily_max_* variables, which was not in the previous version of the patch.
Comment #3
jpetso commented> Additionally, it also deletes the nodefamily_max_* variables,
> which was not in the previous version of the patch.
Er, that is, it deletes those variables *on uninstalling the module*.
Comment #4
fagothanks, committed.
related to this nodeprofile issue, we should also clear and update the configured nodefamily content-type relations, if content types are renamed / removed.
Comment #5
jpetso commentedI tried it this way, please have a look at it.
Comment #6
fagogreat patch, works fine. committed to 5.x and HEAD, thanks.
Comment #7
(not verified) commented