Skip to content

Commit 97664d3

Browse files
author
unknown
committed
fix(admin): purge ALL scope overrides of merge_css/js setting
Migration 266 set dev/{css,js}/merge_{css,js}_files = 0 at the DEFAULT scope but prod kept emitting merged-bundle URLs (each cache flush produced a fresh hash, all of them 404). Diagnostic on prod confirmed the bundle URL stayed in the rendered HTML across migration apply + cache flush + Coolify redeploy. Root cause: Magento config inheritance is default → website → store. A leftover website- or store-scoped row in core_config_data with value '1' shadowed the default '0'. The admin header's View As feature loads whichever store context the operator picked, so a single website override was enough to keep merging on for every admin page render — and the merged bundle URL never existed on disk because the entrypoint wipes media/js/* on every container start. Fix: DELETE every row at every scope for the two paths, then INSERT the default '0'. After this runs there's exactly one row per path (scope=default, value=0) and no override can outrank it. Pair with a cache-flush API call after deploy (/reindex/api/flush?token=...) to invalidate the cached HTML still referencing the dead bundle URL.
1 parent a180360 commit 97664d3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- 271: Purge every scope-level override of dev/css/merge_css_files and
2+
-- dev/js/merge_js_files, then reassert the default to '0'.
3+
--
4+
-- Background: migration 266 disabled CSS/JS merging at the DEFAULT scope, but
5+
-- prod is STILL emitting merged-bundle URLs in admin HTML — confirmed by a
6+
-- diagnostic that showed the merged bundle hash regenerating on each cache
7+
-- flush. Root cause: Magento's config inheritance is default → website →
8+
-- store, so a leftover website- or store-scoped row in core_config_data with
9+
-- value '1' shadows the default '0'. The "View As" feature in the admin
10+
-- header makes admin pages load whichever store context the operator is
11+
-- viewing under, so a single website override is enough to keep the broken
12+
-- merged bundle URL baked into the HTML.
13+
--
14+
-- Fix: delete EVERY existing row at any scope, then INSERT the default '0'.
15+
-- After this runs there is exactly one row per path, scope=default, value=0,
16+
-- and no scope can override it because no overrides exist.
17+
DELETE FROM core_config_data WHERE path IN ('dev/css/merge_css_files', 'dev/js/merge_js_files');
18+
INSERT INTO core_config_data (scope, scope_id, path, value) VALUES
19+
('default', 0, 'dev/css/merge_css_files', '0'),
20+
('default', 0, 'dev/js/merge_js_files', '0');

0 commit comments

Comments
 (0)