fix(setup): add idempotent upgrade for missing content_type.icon and dashboard.customizable#16907
Open
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Open
fix(setup): add idempotent upgrade for missing content_type.icon and dashboard.customizable#16907Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Conversation
…dashboard.customizable Add 3.2.1-pl upgrade script that checks for and adds missing columns when upgrading from broken or partial 3.0.0 upgrades. Fixes 500 errors and empty web context (Unknown column modContentType.icon / modDashboard.customizable). Resolves modxcms#15504
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Adds an idempotent upgrade script for Revolution 3.2.1-pl that ensures the
content_type.iconanddashboard.customizablecolumns exist. Before adding each column it runsSHOW COLUMNS ... LIKE; only if the column is missing it calls$modx->manager->addField(). This repairs installations where the 3.0.0-pl migrations did not run or only partially completed (e.g. upgrade was interrupted or files were replaced without running setup).icononcontent_type, thencustomizableondashboard.Why is it needed?
After upgrading to 3.x, some installations hit 500 errors and an empty web context because the database is missing the
iconandcustomizablecolumns that the application expects. The 3.0.0-pl upgrade adds them, but if that upgrade never ran or failed partway (whilesettings_versionwas already updated), re-running the installer does not re-apply 3.0.0-pl. A new 3.2.1-pl script that runs for all versions < 3.2.1-pl and adds the columns only when missing fixes those broken upgrades.How to test
content_type.iconordashboard.customizable(e.g. restore a backup or manually drop those columns).settings_versionto a value < 3.2.1-pl (e.g.3.0.0-pl).iconand/orcustomizablewhen missing.Optional: Run the upgrade again; the script should do nothing (no duplicate column errors) because the columns already exist.
Related issue(s)/PR(s)
Resolves #15504