Home › Forums › WoodMart support forum › svg icons and php 8
svg icons and php 8
- This topic has 11 replies, 2 voices, and was last updated 2 weeks, 3 days ago by
Luke Nielsen.
-
AuthorPosts
-
May 10, 2023 at 3:51 am #465779
duniesParticipantHello,
I tried to update php on one of my websites where I use svg icons instead of png and they disapperead.Once I rolled back to php 7.4.33 they work again.
Is there a fix for that?
May 10, 2023 at 10:22 am #465801
Luke NielsenKeymasterHello,
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?
Kind Regards
May 10, 2023 at 10:30 am #465808
duniesParticipantHello,
They have been created with your information box.
There is no problem with svg because at header and footer logo are displayed. The problem is caused when svg is used in information boxes.
Sorry I haven’t been that clear before. I have attached a screenshot
Attachments:
You must be logged in to view attached files.May 10, 2023 at 10:36 am #465812
Luke NielsenKeymasterHello,
Please define such SVG images via our element and clarify where I can find them. Also, please send me access to the admin dashboard so I can investigate it.
Kind Regards
May 10, 2023 at 11:15 am #465830
duniesParticipantIn private the details you have asked
May 10, 2023 at 3:48 pm #465930
Luke NielsenKeymasterHello,
To fix this problem, you need to open your SVG logo file with some editor like Sublime Text or the default system text editor and add height and width attributes to your
svg
tag like it is shown on the screenshot (https://prnt.sc/wsuf5ruwr7ij) Make sure that the value is set without % or using px. For example 100 or 100px Then you will need to re-upload your logo in Header Builder.Kind Regards
-
This reply was modified 2 weeks, 3 days ago by
Luke Nielsen.
May 10, 2023 at 3:52 pm #465936
duniesParticipantBefore I write I had tried that with the illustration solution (saved with sublime text cannot be uploaded, I have written that already) that I have used for the logo. But it didn’t work. The problem is the information box with php 8. Once I go back to 7.4.33 it works.
So you cannot fix it?
May 10, 2023 at 3:57 pm #465939
duniesParticipantI reverted the php to 7.4.33. I hope it will be fix on the next updates.
May 10, 2023 at 4:42 pm #465959
Luke NielsenKeymasterHello,
Please make sure that on PHP 8 version you have enabled the “file_get_content” option: https://take.ms/D2ElO
Then recheck the issue with the SVG. Let me know the result.
Kind Regards
May 10, 2023 at 8:54 pm #466029
duniesParticipantHello,
It is enabled on the server because we had come across such an issue last year:
https://xtemos.com/forums/topic/dark-dropdowns-css/#post-368985If you read the whole topic I had managed to fix it with this code :
$opts = array(‘http’=>array(‘header’ => “User-Agent:MyAgent/1.0\r\n”));
//Basically adding headers to the request
$context = stream_context_create($opts);
$html = htmlspecialchars($html);
$html = file_get_contents($url,false,$context);By updating to php 8, this code probably doesn’t work.
The debug shows this: Warning: file_get_contents(https://www.kouskoukis.gr/wp-content/uploads/2022/05/free-delivery-bus-white.svg): Failed to open stream: operation failed in /var/www/vhosts/kouskoukis.gr/httpdocs/wp-content/plugins/woodmart-core/post-types.php on line 728
Can you please check further?
-
This reply was modified 2 weeks, 3 days ago by
dunies.
May 11, 2023 at 2:19 am #466079
duniesParticipantHello,
I contacted my hosting provider and as I was told they have changed some PHP parameters and the PHP version to 8.0.
I’m just sorry I don’t know which parameters and I cannot help other people.
In any case you have to look into the code of information box further.
-
This reply was modified 2 weeks, 3 days ago by
dunies.
May 11, 2023 at 10:03 am #466125
Luke NielsenKeymasterHello,
Please contact the hosting provider and tell them to turn on PHP 8 and the “file_get_content” as well.
https://monosnap.com/file/z65rWKWZRzSINCsD8iiTEl3mNp123x
If the issue will be the same, let us know and we will start to debug the issue.
Kind Regards
-
This reply was modified 2 weeks, 3 days ago by
Luke Nielsen.
-
This reply was modified 2 weeks, 3 days ago by
-
AuthorPosts
- You must be logged in to create new topics. Login / Register