Bug #23074 Version Retired

Fieldtype updates are called twice

Version: 2.11.8 Reporter: Dom Stubbs

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

I’m not sure if it’s worth reporting 2.X bugs any longer, but I’ve noticed an issue with the fieldtype update code in 2.11.8.

In addons_fieldtypes.php, line 247:

if ($FT->info['version'] > $version && method_exists($FT, 'update') && $FT->update($version) !== FALSE)
    if ($this->api_channel_fields->apply('update', array($version)) !== FALSE)
     $this->db->update('fieldtypes', array('version' => $FT->info['version']), array('name' => $ft));

If you look at the end of the first line it’s calling the update() method only for apply('update’)to do the same thing, albeit via a callback, a line later. Since the same $version will be passed with each call it’s likely that fieldtypes will end up attempting to apply schema updates twice.

Removing one of the update calls is a fix for at least this Matrix update bug and probably others too.

  • Nobody has said anything yet.
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases