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.

Comments

fago’s picture

great improvements!

However couldn't we use node_get_types('names') ?

jpetso’s picture

StatusFileSize
new5 KB

Ah, 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.

jpetso’s picture

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

fago’s picture

thanks, committed.

related to this nodeprofile issue, we should also clear and update the configured nodefamily content-type relations, if content types are renamed / removed.

jpetso’s picture

Status: Active » Needs review
StatusFileSize
new6.02 KB

I tried it this way, please have a look at it.

fago’s picture

Status: Needs review » Fixed

great patch, works fine. committed to 5.x and HEAD, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)