Closed mscherr-fastspot closed 10 months ago
Hi, @mscherr-fastspot, how are you rendering Admin Bar on your template (using the adminbar
Twig tag or using getAdminBarAssets
along with it)? Can you please share the Twig code you're using?
Also, I just tried this out in the beta version of Admin Bar 4 and it doesn't seem to be an issue anymore. If it turns out there is a bug in the 3.2.x version I'll go back and fix it, but FYI it doesn't seem to be an issue in the newer version.
@wbrowar I am using the Twig tag:
{% if entry is defined %}
{{ adminbar({
entry: entry
}) }}
{% endif %}
Hmm well I think there are a couple of ways we could solve this. One route could be to change the single quotes to double quotes. Or we could update the font stack to something that won't run into this issue. Because this is stored in settings, I wonder if it's a database storage issue.. In that case then I could see this still being an issue in the 4.0 version.
Would you mind trying out the beta version of 4.0? You can do this by updating Admin Bar via composer:
{
"require": {
"wbrowar/adminbar": "dev-4.x-craft-4"
},
}
If you don't want to install the beta, then please let me know if you have any luck with using double quotes or by changing the font stack. If one of those options works for you I'll look into updating the default.
re - single to double quotes:
I get the same error using 3.2.0:
:root {
--adminbar-font-stack: "JJannon Display", Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif";
--adminbar-bg: #0c2142;
}
re - dev-4.x-craft-4
version
I installed, but got an error on every page; I wasn't able to debug further at this time, I'm sorry:
I am ok for now; it's not the biggest deal in the world. I think I'll just leave the font family as the default one. I appreciate you looking into it though.
Hi, @mscherr-fastspot, I'm sorry, I can’t seem to re-create this. I'm using a PHP 8.0, and a MySQL based DB. I've tried different combinations of Custom CSS settings to add in singe quotes, double quotes, and some unfinished quotes.
My only other thought is it could be due to another module or maybe some setting that is trying to bundle your CSS that comes from Twig/Craft.
Regarding the Beta version, I updated it with a new version last night. I didn't have anything in there that specifically addresses this issue of it crashing, but something in there might make it work better.
Here's my info if it helps:
But you're right, it might be something on my end then with another plugin. You can close this ticket if you would like. Thanks again for looking into it. If you can't replicate, I'm sure it's from another plugin or some of my own code.
If I end up debugging it further and finding anything I'll let you know!
Sounds good, @mscherr-fastspot. I'll close it for now, but I'm going to get my development environment working on PHP 8.2 and when I do that I'll make sure to test my settings again.
Craft CMS Version - 4.5.11.1 Plugin Version - 3.2.0
The example used for changing the font stack is:
... but when adding that exact example into the "Colors > Custom CSS" text box:
... on the front end the custom property is invalid, and the preview shows
'
as the first few characters, leading me to believe quotes are being escaped.Example of settings page: