1

We have a custom module which has successfully used the update method in upd.addon-name.php to apply database changes. We are attempting to use it again for another version update (from 1.4.0 to 1.5.0). This time however, ExpressionEngine says it successfully runs the module update (no error is thrown), but fails to update the version number in exp_modules. It does this whether or not you update via the "run module updates" button or by visiting the settings for the add-on.

This leads to an attempt to run the upgrade again whenever you visit the settings page for the module, which throws mysql errors complaining about duplicate columns (because it already added them).

Has anyone ever encountered this before? Is it safe to update the version in that table ourselves in the update function as a workaround?

I should mention this has occurred on ExpressionEngine version 2.7.3 on two separate installations.

1 Answer 1

1

What code do you have in your update() method? I believe you need to return true from the update method for the database table to be updated.

That said, in Store we simply update the exp_modules table manually (since from memory you have to do this for extensions anyway), so there's certainly no problem just doing this yourself.

1
  • 1
    Turns out the path through the update function did lead to a return false statement. Not sure why that was in there to begin with. Mar 7, 2014 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.