Bug #21524 See Comments

Fieldtypes with accompanying modules never update version number without their own update() method.

Version: 3.1.1 Reporter: Greg Ferrell

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

In `/EllisLab/ExpressionEngine/Controller/Addons/Addons.php->update()` a fieldtypes version number will never update unless it both has an update method and returns `true`. This happens regardless if there is a upd.addon.php file or not.

Given that modules run first in that scenario, upd.addon.php could very well update the version numbers of every addon type itself, unless the module version number somehow get updated and the fieldtype version number did not. (This happened to us with an addon due to the below mentioned mishap.)

This is remedied by adding an update() method in the fieldtype itself and returning true which will prompt the version number update.

If you do not have an update() method in your fieldtype and your upd.addon.php does not update the fieldtype version number, you get an infinite ‘upgrade’ prompt on the addons page. You cannot fix this by updating upd.addon.php in another version because it will never get run due to the module version number being updated already.

Therefore you must have a dummy update() method in your fieldtype if they get out of sync on accident.

  • My suggestion would be to add this into the EE_fieldtype abstract:

    public function update($version)
     {
      return true;
     }

    This way by default fieldtypes that have no update but a new version number get updated correctly.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases