If I insert info
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
this code
<link src="//fonts.googleapis.com/css?family=Open+Sans|Roboto+Condensed|Open+Sans+Condensed:400,300,300italic,400italic,600,600italic,700italic,700&subset=latin,cyrillic" src_type="url" />
I got errors Theme layout update file default_head_blocks.xml' is not valid. EntityRef: expecting ';'
and if I replace & with &
I got exception.
or If I remove &subset=latin,cyrillic
- works perfectly
@luckyraul thanks for reporting the issue. We created internal MAGETWO-44935
Hi there
Is there any information regards this bug as I am experiencing the same issue on version 2.0.2.
Thanks
Hey guys. Replacing &
in the path with &amp;amp;
seems to work for me. The problem seems that the xml code is escaped three times for me. If it does not work for you, try adding or removing the amp;
part as many times as needed until it works.
Thanks for investigating further. That may work, but it does not mean it is right! I think you should be able to do &
. I have a suspicion around decoding and encoding when we merge xml docs. Eg it smells like we are not doing an encode during serialization,
Yes, it was meant only as a temporary workaround for anyone who needs to use other subsets. I am sorry if it was confusing.
I also couldn't find anywhere how to remove the default Open Sans from theme because simple loading of the Google Fonts version did not overwrite the local font. I had to rewrite _typography.less. I think that there should be a more simple way to do this or at least a note in the docs that you need to do this if you need to use different subset and still want to use Open Sans.
Any update on this issue? it is a major blocker if you are using CDN as you should be for any store that has extended latin alphabet.
As @PingusPepan wrote replacing & with &amp; works. It looks crazy but it works. Thank you you solved me hours of whatever.
@luckyraul, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9
@magento-engcom-team good timing (2 year for quick resolve )
@magento-engcom-team @orlangur
just checked on 2.2.0, still failing with report with one &
I don't know about 2.3.0-dev, but on 2.2.0 single ampersand was definitely not working for me. Can anyone link the commit that is supposed to fix this bug?
@magento-engcom-team please re-check. According to reports provided in 2.2.0 it should work with &amp;amp;
syntax but fail with &
which is not correct.
@luckyraul, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9
@luckyraul, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9
@magento-engcom-team @orlangur @PingusPepan
Stop this "close ticket first, don't care about problem"
At least two people confirmed - there is the problem.
@luckyraul nope, there is no problem.
It was rechecked TWICE. To reopen it one more time there should be some more information.
@orlangur My steps to reproduce:
Theme child of base theme.
update layout file from Magento_Theme (Magento_Theme/layout/default_head_blocks.xml
)
Inserting this:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="https://fonts.googleapis.com/css?family=Montserrat:200,300,400,500,600&subset=latin-ext" src_type="url" />
</head>
</page>
or this:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="https://fonts.googleapis.com/css?family=Montserrat:200,300,400,500,600&subset=latin-ext" src_type="url" />
</head>
</page>
does not work. Errors produced are:
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Theme layout update file '/srv/www/[redacted]/magento2/app/design/frontend/[redacted]/Magento_Theme/layout/default_head_blocks.xml' is not valid.
EntityRef: expecting ';'
Line: 4
for the first example and
Exception #0 (Exception): Warning: simplexml_load_string(): Entity: line 5874: parser error : EntityRef: expecting ';' in /srv/www/[redacted]/magento2/lib/internal/Magento/Framework/View/Model/Layout/Merge.php on line 501
for the second example.
I would expect the second example to work but what works for me instead is this mess:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="https://fonts.googleapis.com/css?family=Montserrat:200,300,400,500,600&amp;amp;subset=latin-ext" src_type="url" />
</head>
</page>
Please try my steps and see if you can get the same results as me.
This is on Magento 2.2.0
@PingusPepan thanks! @magento-engcom-team could you please check if you tried exactly the steps described by @PingusPepan?
@luckyraul, thank you for your report.
We've created internal ticket(s) MAGETWO-44935 to track progress on the issue.
Unbelievable. Magento, you cannot reproduce this? I was wondering... how do you manage to reproduce more serious bugs??
You just need to put ONE line of code in your XML and you will reproduce it. there are no 100 steps, there are no 100 files. amazing!
What's even more amazing - this was reported 3 years ago.
I confirm this bug also.
Fixed using &amp;amp;
Magento 2.2.3
@Nenad-Inchoo saw your comment earlier but didn't get it. It was reproduced on Nov 7, 2017 (not from the first attempt, but...), label was here by mistake :)
this bug is happening to me, Magento 2.2.2
Also happening here;
Not working;
<script src="//maps.googleapis.com/maps/api/js?key=<keyhere>&libraries=places" src_type="url" />
Working;
<script src="//maps.googleapis.com/maps/api/js?key=<keyhere>&amp;amp;libraries=places" src_type="url" />
@jevgenijmokrousov - As frustrating as software bugs and poor processes can be, there is absolutely zero reason for that harmful statement.
I'm working on #cd-balance
Can confirm this still exists in 2.2.5
Hi
Is there any information regards this bug as I am experiencing the same issue on version 2.2.6
I need add new customize google fonts
Thanks
In regards of performance and privacy it is generally recommended to host these fonts yourself.
@danielruf regardless of whether that is true, that's not the point of this issue.
Sure. Did anyone come up with a PR so far or find solutions? Because this is an opensource project which lives from contributions.
@GNUXDAR Not a fix, but a temporary workaround is indicated in @PingusPepan's first comment.
Hi @denisflosi1. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.[ ] 2. Verify that the issue is reproducible on 2.3-develop
branchDetails
- Add the comment @magento-engcom-team give me 2.3-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop
branch, please, add the label Reproduced on 2.3.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. Verify that the issue is reproducible on 2.2-develop
branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop
branch, please add the label Reproduced on 2.2.x
[ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.
@magento-engcom-team give me 2.1-develop instance
Hi @denisflosi1. Thank you for your request.
Unfortunately, I can only deploy instances for 2.2
and 2.3
release lines
Hi @denisflosi1. Thank you for your request. I'm working on Magento 2.2-develop instance for you
Hi @denisflosi1, here is your Magento instance.
Admin access: https://i-2228-2-2-develop.instances.magento-community.engineering/admin
Login: admin
Password: 123123q
Instance will be terminated in up to 3 hours.
Hi @sergey-solo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.[ ] 2. Verify that the issue is reproducible on 2.3-develop
branchDetails
- Add the comment @magento give me 2.3-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop
branch, please, add the label Reproduced on 2.3.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. Verify that the issue is reproducible on 2.2-develop
branch. Details
- Add the comment @magento give me 2.2-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop
branch, please add the label Reproduced on 2.2.x
[ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.
Didn't have time to finish this. Check the line on lib/internal/Magento/Framework/Simplexml/Element.php:248
Potential fix may be to replace this:
$out .= ' ' . $key . '="' . str_replace('"', '\"', (string)$value) . '"';
with this:
$out .= ' ' . $key . '="' . str_replace('"', '\"', $this->xmlentities($value)) . '"';
Fixes the issue(requires to use &
instead of just &
) but isn't fully tested.
Still exists in 2.2.7
.
Okay. You too. See https://github.com/magento/magento2/issues/2228#issuecomment-434589610
Not sure what you mean, you linked to my comment that I referenced.
Seems that @sergey-solo 's solution works.
Hi @sergey-solo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.[ ] 2. Verify that the issue is reproducible on 2.3-develop
branchDetails
- Add the comment @magento give me 2.3-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop
branch, please, add the label Reproduced on 2.3.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.
Hi @luckyraul. Thank you for your report.
The issue has been fixed in magento/magento2#24336 by @sergey-solo in 2.3-develop branch
Related commit(s):
The fix will be available with the upcoming 2.3.4 release.
Most helpful comment
Unbelievable. Magento, you cannot reproduce this? I was wondering... how do you manage to reproduce more serious bugs??
You just need to put ONE line of code in your XML and you will reproduce it. there are no 100 steps, there are no 100 files. amazing!
What's even more amazing - this was reported 3 years ago.