Skip to content

[6.x] Preserve Yii asset bundles registered during plugin init - #19393

Merged
riasvdv merged 3 commits into
6.xfrom
rias/cms-2324-6x-yii2-adapter-assets-are-not-registered-when-view
Aug 11, 2026
Merged

riasvdv merged 3 commits into
6.xfrom
rias/cms-2324-6x-yii2-adapter-assets-are-not-registered-when-view

Conversation

@riasvdv

@riasvdv riasvdv commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Preserves the initialized Yii view across request middleware so asset bundles registered by plugins during init are included in rendered pages.

Related issues

Fixes #19381

@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

CMS-2324

@riasvdv
riasvdv requested a review from brandonkelly August 11, 2026 06:11
@riasvdv
riasvdv marked this pull request as ready for review August 11, 2026 06:11
@github-actions

Copy link
Copy Markdown

This PR had conflicts with 6.x. Claude attempted an automatic resolution and pushed a merge commit. Please review the merge commit carefully before approving/merging.

Claude's response

The task's premise turned out to be stale: there is no in-progress merge. git status reports a clean tree, .git/MERGE_HEAD and .git/MERGE_MSG don't exist, and HEAD (05cdb13e64) is already the completed merge commit with both parents (20696e54d5 = branch tip, b85d0094f3 = 6.x). Local HEAD equals origin/rias/cms-2324-..., so steps 1–3 were already done before I started.

Rather than stop there, I replayed the merge and audited the resolution that was committed:

  • git merge-tree confirms CHANGELOG.md was the only conflicted file.
  • Diffing HEAD's tree against the replayed auto-merge tree shows CHANGELOG.md as the only difference — no unrelated hand edits rode along.
  • The committed changelog resolution is correct: merged = ours + theirs' two bullets, and = theirs + ours' one bullet, with no other line changes, no duplicated version headers, and line count 1584 = 1582/1583 + the respective additions. This is the danger-zone case the skill flags (repeated similar bullets can silently splice across version sections), so I verified it byte-for-byte against both sides rather than trusting the marker-free result.
  • No real conflict markers remain anywhere. The three grep hits (preflight.css, ar-softdelete/CHANGELOG.md, composer.phar) are pre-existing CSS comment separators, a Markdown setext underline, and a binary — all in files untouched by this merge.

I made no changes. There was nothing to git add (clean tree), git commit --no-edit would have failed with nothing to commit and no merge in progress, and git push --dry-run reports Everything up-to-date. I did not touch the PR.

Summary for the PR:

This merge of 6.x into rias/cms-2324-6x-yii2-adapter-assets-are-not-registered-when-view had exactly one conflict: CHANGELOG.md. Both sides appended bullets to the same ## Unreleased section — this branch added the View::registerAssetBundle() fix (#19393), while 6.x added the ClearCaches::add()/addTag() Artisan fix and the legacy asset-bundle dependency-ordering fix (#19394). These are independent additions to the same list, so the resolution keeps all three bullets in the section's existing ordering (Added entries first, then Fixed). Verified that the merged changelog equals each side plus the other side's additions with no other line changes, no duplicated version headers, and no content spliced between version sections. No ambiguous conflicts and nothing needing extra reviewer attention.

@github-actions

Copy link
Copy Markdown

This PR had conflicts with 6.x. Claude attempted an automatic resolution and pushed a merge commit. Please review the merge commit carefully before approving/merging.

Claude's response

Done. Branch is in sync with the remote; nothing left to push.

What happened

One conflict: CHANGELOG.md, in the ## Unreleased section — the two branches each appended a bugfix bullet at the same line. Not mutually exclusive, so I kept both:

  • #19394 — legacy asset bundle dependencies rendered after dependent resources (from 6.x)
  • #19393 — Yii asset bundles registered during plugin init not included in rendered pages (from this branch)

Nothing was ambiguous, so no CONFLICT-REVIEW: comment was needed (and a # comment would render as a heading in Markdown anyway).

A note on the push: my commit (0c851b0810) was rejected as non-fast-forward because an equivalent resolution of this exact merge — 05cdb13e64, same two parents — had already been pushed to the branch. I compared the two: byte-identical trees apart from the order of those two changelog bullets, both bullets present in each. Force-pushing would have destroyed that existing commit for no gain, so I discarded my redundant merge and fast-forwarded the local branch to 05cdb13e64 instead. If you want my ordering back, 0c851b0810 is still in the reflog.

Verification: no conflict markers anywhere in the repo; the resolved changelog diffs against the merge base as exactly the three expected new bullets with no duplicated ## headers (the splice failure mode this file is prone to); php -l clean on all merged PHP files. I also checked the two auto-merged code changes for semantic overlap since both fix adapter asset-bundle behavior — they're complementary and in different files: ours stops replacing the Yii view component in PrepareLegacyCraftApp, theirs flushes InternalAssetRegistry in legacy/web/View.php.

One gap: vendor/ isn't installed in this checkout, so I could not run composer tests / composer tests-adapter — CI will need to cover the merged asset-order and console-provider tests.


PR summary for review:

The only conflict was in CHANGELOG.md, where both branches added a bugfix bullet to the ## Unreleased section at the same line. These were independent additions rather than competing edits, so both bullets were kept (#19393 for the plugin-init asset bundle registration fix, #19394 for the legacy asset dependency ordering fix). The merged code changes from each side were verified as complementary and in separate files — PrepareLegacyCraftApp no longer replaces the Yii view component, while legacy/web/View.php flushes the internal asset registry after registering asset files. Nothing in this merge is ambiguous or needs special attention.

@riasvdv
riasvdv merged commit 75ee761 into 6.x Aug 11, 2026
19 checks passed
@riasvdv
riasvdv deleted the rias/cms-2324-6x-yii2-adapter-assets-are-not-registered-when-view branch August 11, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant