Home Forums WoodMart support forum svg icons and php 8

svg icons and php 8

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #465779

    dunies
    Participant

    Hello,
    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?

    #465801

    Luke Nielsen
    Keymaster

    Hello,

    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

    #465808

    dunies
    Participant

    Hello,

    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.
    #465812

    Luke Nielsen
    Keymaster

    Hello,

    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

    #465830

    dunies
    Participant

    In private the details you have asked

    #465930

    Luke Nielsen
    Keymaster

    Hello,

    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 10 months, 3 weeks ago by Luke Nielsen.
    #465936

    dunies
    Participant

    Before 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?

    #465939

    dunies
    Participant

    I reverted the php to 7.4.33. I hope it will be fix on the next updates.

    #465959

    Luke Nielsen
    Keymaster

    Hello,

    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

    #466029

    dunies
    Participant

    Hello,

    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-368985

    If 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 10 months, 3 weeks ago by dunies.
    #466079

    dunies
    Participant

    Hello,

    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 10 months, 3 weeks ago by dunies.
    #466125

    Luke Nielsen
    Keymaster

    Hello,

    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 10 months, 3 weeks ago by Luke Nielsen.
    #471552

    dunies
    Participant

    Hello, regarding this issue that still occurs I got the reply you can see in private from my hoster.

    #471728

    Luke Nielsen
    Keymaster

    Hello,

    This error is related to the fact that you have (or had) an image in the media that does not have a title.

    https://monosnap.com/file/UlgQGtFlma9worBK3AeZRIyvftFNa5

    So you need to check all titles upon availability related to the image via Dashboard -> Media. In general, this error is not critical.

    Kind Regards

Viewing 14 posts - 1 through 14 (of 14 total)