The configuration in previous versions used a set of variables named front_page_* and front_page2_size.

Version 4.7.4.1 now uses variables front_<rid>_*, but the module includes no update routine to migrate the older configuration, or at least to remove it in order to avoid orphan variables in variables.

Alternatively, the README.txt could be modified to include a warning about this change the procedure to be followed when updating.

CommentFileSizeAuthor
#5 front_page.install.txt827 bytesbeginner
#2 front_page.tar_.gz472 bytesfgm

Comments

beginner’s picture

Version: 4.7.x-4.1 » master

D5 sites may still have this variable left over, too.

The best would be to add a front_update_N() function in HEAD to unset the said variables:
this way, whenever one upgrades (to D5 or to D6), the variable will be deleted.

fgm’s picture

Version: master » 4.7.x-4.1
Status: Active » Needs review
StatusFileSize
new472 bytes

The attached file is a .install for use in the 4.7.4.1 release.

Beware, this might be my first install file.

beginner’s picture

Version: 4.7.x-4.1 » master
Status: Needs review » Needs work

There won't be any more release for 4.7.
People will catch the update when updating to D5 or D6.
Anyway, since it's a new file, it will apply in any branch.

http://api.drupal.org/api/function/hook_update_N/5
hook_update() is supposed to return a unidimensional array.
Can you point to where the use of a multi-dimensional array, as your are using here, is documented?

    $ret[] = array(
      'success' => true,
      'query' => t('Removing old variable %var', array('%var' => $o->name))
    );
fgm’s picture

Version: master » 4.7.x-4.1
Status: Needs work » Needs review

It is described in the handbook: http://drupal.org/node/51220

under the title "Update instructions": All updates should return an array listing all the actions performed and whether they succeeded. Each action is an array containing a success boolean and a query string.

you don't notice it in the hook_update_N reference because it returns the result of update_sql which may make you think it's a scalar, but that function actually returns such an array.

Regarding the version, the selector does not include HEAD for me, only the 2 4.7.x and the 2 5.x. Dunno why.

beginner’s picture

Status: Needs review » Needs work
StatusFileSize
new827 bytes

Thank you for the pointers.

I started making some minor code adjustment to the file when I noticed a serious bug.

Can you say which version of the module have the obsolete variables?
What are the variables' name, exactly?
Which version changed the naming of the variables?

The update will unset all the variables like 'front_page%' . The problem is that it will also delete variables that are still in use: front_page_breadcrumb and front_page_breadcrumb_redirect.

fgm’s picture

I don't know about the other branches, but for 4.7.x, the changes was apparently introduced in 4.7.4.1, for which the variables now include the role_id.

However, you're right: it also uses front_page_breadcrumb and front_page_breadcrumb_redirect which should therefore not be removed.

It looks like an accurate list of the variables used in previous versions will be necessary if we don't want the upgrade to just wipe the config information to set up the module as if it was a fresh install (which is what this version of the install file is about, actually: cleaning up older versions, not carrying over config).

Dublin Drupaller’s picture

Status: Needs work » Closed (fixed)