[18.0][FIX] web_company_color: regenerate legacy color attachments on upgrade#1
Open
eantones wants to merge 1 commit into
Open
[18.0][FIX] web_company_color: regenerate legacy color attachments on upgrade#1eantones wants to merge 1 commit into
eantones wants to merge 1 commit into
Conversation
… upgrade Databases upgraded from older versions keep the per-company color attachments in the legacy format (raw SCSS, application/octet-stream). The module now compiles the SCSS server-side and serves the attachment directly as a stylesheet, so browsers refuse the legacy ones under strict MIME checking and company colors silently stop applying. Only post_init_hook (fresh installs) regenerates them — add a post-migration so upgrades do too.
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.
Databases upgraded from older versions still carry the per-company color attachments in the legacy format: raw SCSS content with mimetype
application/octet-stream. The current module compiles the SCSS server-side and links the attachment URL directly as a stylesheet, so it needs compiled CSS with mimetypetext/css— browsers refuse the legacy attachments under strict MIME checking ("Refused to apply style ... not a supported stylesheet MIME type") and company colors silently stop applying after the migration.Only the
post_init_hookregenerates the attachments, and it runs on fresh installs only — upgrades never do. Add a post-migration (with a version bump to 18.0.1.1.1) that calls the module's ownscss_create_or_update_attachment()for all companies. Idempotent; databases already in the current format are simply rewritten identically.Verified on a real 14.0 → 18.0 migration (10 companies): before, the browser refused all 10 attachments and the corporate colors were missing; after regeneration all attachments serve as
text/cssand the colors apply again.