Skip to content

[18.0][FIX] web_company_color: regenerate legacy color attachments on upgrade#1

Open
eantones wants to merge 1 commit into
18.0from
18.0-fix-web_company_color-regenerate-attachments
Open

[18.0][FIX] web_company_color: regenerate legacy color attachments on upgrade#1
eantones wants to merge 1 commit into
18.0from
18.0-fix-web_company_color-regenerate-attachments

Conversation

@eantones

Copy link
Copy Markdown
Member

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 mimetype text/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_hook regenerates 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 own scss_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/css and the colors apply again.

… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant