Bug #23074 New

Fieldtype updates are called twice

Version: 2.11.8 Reporter: Dom Stubbs

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.

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases