Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Added `CraftCms\Cms\Http\Responses\CpScreenResponse::screenData()`. ([#19354](https://github.com/craftcms/cms/pull/19354))
- Fixed a bug where cache options and tags registered via `CraftCms\Cms\Utility\Utilities\ClearCaches::add()` and `addTag()` were unavailable as Artisan commands.
- Fixed a JavaScript error that occurred on non-Inertial pages that rendered field layout designers. ([#19380](https://github.com/craftcms/cms/discussions/19380))
- Fixed a bug where Yii asset bundles registered with `craft\web\View::registerAssetBundle()` during plugin initialization were not included in rendered pages. ([#19393](https://github.com/craftcms/cms/pull/19393))
- Fixed a bug where legacy asset bundle dependencies could be rendered after their dependent resources when using `craftcms/yii2-adapter`. ([#19394](https://github.com/craftcms/cms/pull/19394))

## 6.0.0-alpha.16 - 2026-08-05
Expand Down
1 change: 0 additions & 1 deletion yii2-adapter/src/Http/PrepareLegacyCraftApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ private function refreshRequestScopedComponents(Request $request): void
$yiiRequest->csrfCookie = Craft::cookieConfig([], $yiiRequest);

Craft::$app->set('request', $yiiRequest);
Craft::$app->set('view', Craft::createObject(App::viewConfig()));
Craft::$app->set('user', Craft::createObject(App::userConfig()));
}
}
28 changes: 28 additions & 0 deletions yii2-adapter/tests-laravel/Http/PrepareLegacyCraftAppTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

use CraftCms\Yii2Adapter\Http\PrepareLegacyCraftApp;
use Illuminate\Http\Request;
use yii\web\AssetBundle;

it('preserves asset bundles registered before request middleware runs', function() {
Craft::$app->getView()->registerAssetBundle(InitRegisteredAsset::class);

$html = app(PrepareLegacyCraftApp::class)->handle(
Request::create('/'),
fn() => Craft::$app->getView()->placeholderHtml(),
);

expect($html['headHtml'])->toContain('/cms-2324.css')
->and($html['bodyEndHtml'])->toContain('/cms-2324.js');
});

class InitRegisteredAsset extends AssetBundle
{
public $baseUrl = '/';

public $css = ['cms-2324.css'];

public $js = ['cms-2324.js'];
}
Loading