Okay
  Public Ticket #3079353
Cannot import LayerSlider Templates
Closed

Comments

  • Amila started the conversation

    Hi, 

    I'm trying to import LayerSlider templates to get started with. But it's giving me a internal server error. Following is a stack trace from the server logs. 

    2022-07-06T10:57:40.700123836Z 2022/07/06 10:57:40 [error] 158#158: *68 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Undefined constant "GLOB_BRACE" in /home/site/wwwroot/wp-content/plugins/LayerSlider/assets/classes/class.ls.filesystem.php:25
    2022-07-06T10:57:40.700153636Z Stack trace:
    2022-07-06T10:57:40.700159636Z #0 /home/site/wwwroot/wp-content/plugins/LayerSlider/assets/classes/class.ls.importutil.php(350): LS_FileSystem::emptyDir('/home/site/wwwr...')
    2022-07-06T10:57:40.700178737Z #1 /home/site/wwwroot/wp-content/plugins/LayerSlider/assets/classes/class.ls.importutil.php(69): LS_ImportUtil->cleanup()
    2022-07-06T10:57:40.700183037Z #2 /home/site/wwwroot/wp-content/plugins/LayerSlider/assets/wp/actions.php(1225): LS_ImportUtil->__construct('/home/site/wwwr...', '/home/site/wwwr...', 'Global Hover Ex...')
    2022-07-06T10:57:40.700187037Z #3 /home/site/wwwroot/wp-includes/class-wp-hook.php(307): ls_import_online('')
    2022-07-06T10:57:40.700199037Z #4 /home/site/wwwroot/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    2022-07-06T10:57:40.700202637Z #5 /home/site/wwwroot/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    2022-07-06T10:57:40.700206037Z #6 /home/site/wwwroot/wp-admin/admin-ajax.php(187): do_action('wp_ajax_ls_impo...')
    2022-07-06T10:57:40.700209237Z #7 {main}
    2022-07-06T10:57:40.700212437Z   thrown in /home/site/wwwroot/wp-content/plugins/LayerSlider/assets/classes/class.ls.filesystem.php on line 25" while reading response header from upstream, client: 169.254.129.1, server: _, request: "GET /wp-admin/admin-ajax.php?action=ls_import_online&slider=global-hover-example&name=Global%20Hover%20Example&security=da9b81bb56 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php-fpm.sock:", host: "layer-slider.dev.iagto.net", referrer: "https://layer-slider.dev.iagto.net/wp-admin/admin.php?page=layerslider"

    The wordpress site is running on a docker container with appsvc/wordpress-alpine-php:latest as the base image. In alpine versions of php, it seems GLOB_BRACE is not available. 

    Please see a similar issue reported on a different plugin. Compatibility with systems without GLOB_BRACE and PHP8 · Issue #6079 · osTicket/osTicket (github.com)

    Any help much appreciated.

    Kind regards,
    Amila

  •  69
    John replied

    Hi Amila,

    Thank you for getting in touch with us. My name is John and I'm happy to assist you today. I appreciate your patience while we've been working towards your ticket.

    I'd like to thank you for the detailed bug report; it was very helpful. You're right, Alpine versions of PHP do not support the GLOB_BRACE flag. We'll investigate what we can do about it, and will release an update in the near future with a fix or workaround. 

    Thank you for letting us know about this issue, and I appreciate your patience while we try to find a solution to this issue.

    Best Regards,
    John | Kreatura Dev Team

  • Amila replied

    Hi John,

    Thank you for getting back to me.

    As a temp solution, I've removed GLOB_BRACE parameter from the code and so far it has not thrown any other errors. I was able to import templates after the change. I'm not a PHP developer myself, so not sure the importance of GLOB_BRACE. Please let me know when this is fixed.

    Kind regards,
    Amila

  •  69
    John replied

    Removing GLOB_BRACE can lead to unexpected issues with consecutive template imports since LayerSlider likely won't be able to remove the temporary files created by the import process. We're already preparing a patch for this issue that will be included in the upcoming update we plan to release early next week.

    Thank you again for letting us know about this issue, and I appreciate your patience. 

    Best Regards,
    John | Kreatura Dev Team