Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run needed updates during activation before activation action #713

Open
JDGrimes opened this issue Aug 10, 2017 · 1 comment
Open

Run needed updates during activation before activation action #713

JDGrimes opened this issue Aug 10, 2017 · 1 comment

Comments

@JDGrimes
Copy link
Member

While working on #404, I happened to think that when the activation code for an installable is run, it will run before any updates that are needed are run, because the update code is triggered by the extensions loaded action, but activation will happen after that. It occurred to me that this could potentially cause problems, because the activation code will likely be expecting the database to be
up to date. We have not yet experienced any issues from this that we know of, but it is possible that it could bite us in the future, especially when the installable has been deactivated over the course of several code updates that need database updates to run as well

Of course, it is also possible that this change could cause unforeseen issues itself, so I think it needs more consideration before we make a decision as to the right behavior here.

@JDGrimes
Copy link
Member Author

I suppose that something similar could be said for uninstall: if the code was updated after deactivation, the latest updates wouldn't have run, meaning that the uninstall routine would potentially be expecting the database to be in a different state. This could lead to problems, although in most cases it wouldn't (for example, deleting an option that doesn't exist does nothing). In the case of DB tables, they should only be dropped if they exist, or else database errors will occur. But we already use DROP TABLE IF EXISTS queries anyway, so there should be no problem there. It is something to keep in mind though.

JDGrimes added a commit that referenced this issue Aug 21, 2017
To ensure that it is added to a list, if the installable object is added
in a code update after the extension is initially released.

We also tweak the installable class to ensure that site IDs are only
added once.

Fixes #715
See #404, #714, #713, #704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant