Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order "0" is seen as "1" #12

Open
Eddcapone opened this issue Mar 6, 2020 · 2 comments
Open

Order "0" is seen as "1" #12

Eddcapone opened this issue Mar 6, 2020 · 2 comments

Comments

@Eddcapone
Copy link

Eddcapone commented Mar 6, 2020

You wrote Any tags without an explicit order will come as they appear normally (effectively treated like they have an order of 1).

So I added a script with order 0, so that it gets ordered to the very top:

<css src="css/bootstrap.min.css" order="0"/>

But it is not.

I also tried 10 but then it gets ordererd at the bottom.

@Eddcapone Eddcapone reopened this Mar 6, 2020
@Eddcapone
Copy link
Author

I figured out that if you set the order to 0 it will be seen as "1" in
View\Page\Config\Renderer.php in Method _afterRenderAssets.

It goes in if(!isset($this->_aAssetOrder[$sSearch]) || $this->_aAssetOrder[$sSearch] == 1) {

@Eddcapone Eddcapone changed the title Order "0" has no effect Order "0" is seens as "1" Mar 6, 2020
@Eddcapone Eddcapone changed the title Order "0" is seens as "1" Order "0" is seen as "1" Mar 6, 2020
@Eddcapone
Copy link
Author

Eddcapone commented Mar 6, 2020

We could workaround it by overriding $oFile->setOrder(1); to $oFile->setOrder(10); in View\Asset\PropertyGroup.php and then we can use 1 instead of 0. But this might break some shops, since people who already set their order and update the extension will face bugs because the order gets confused again.

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

No branches or pull requests

1 participant