Okay
  Public Ticket #1399507
Markup of slides not rendered after update to 6.6.5
Closed

Comments

  • Andis started the conversation

    It appears that the latest update has some issues with slide markup rendering. There should be a slider on the home page with three slides containing only text. I've verified that the slides are there in the back-end and perfectly fine. I've exported the slider and attached the zip file for reference.

    I have tried everything suggested in the documentation but nothing helps.

    1. Caching is not the issue;

    2. Theme compatibility is not the issue;

    3. Other plugins disabled and tested. Not the issue;

    I even tried deleting all plugin data and importing the exported slider. Still no luck. However, on a development site with same theme the imported slider works as expected and outputs correct HTML with all slides.


    As far as I can tell, it is an issue in the latest version (6.6.5).

    Update:

    After turning on debugging, I discovered three PHP notices about undefined array index 'type' for each of the three slides:

    Notice: Undefined index: type in /var/www/[...]/wp-content/plugins/LayerSlider/includes/slider_markup_html.php on line 263
    Notice: Undefined index: type in /var/www/[...]/wp-content/plugins/LayerSlider/includes/slider_markup_html.php on line 271
    Notice: Undefined index: type in /var/www/[...]/wp-content/plugins/LayerSlider/includes/slider_markup_html.php on line 306
    

    It is best practice to initialise variables before using them.

    Unfortunately I can't fix this issue to see if it helps on production server since the plugin has been updated by wp-cli using a cron job run my root and files are owned by root user.

  • [deleted] replied

    Hello Andis,

    Thank you for getting in touch with us. My name is Attila and I'm happy to assist you today.

    I would like to confirm that we have received your message. Due to the nature of the issue you are experiencing, I will have to contact and consult with the development team first. I will get back to you as soon as I can.

    We appreciate your patience while we're working towards your ticket.

  •  73
    John replied

    Dear Andis,

    We believe this issue is most likely related to the PHP version you're using on the web server. Recently we discovered that PHP 7.2.0 can cause issues like this. Since that version was released just a couple of days ago, we wouldn't recommend to use it on production sites. It is a custom in the industry as new and major releases often suffer from various issues.

    We will investigate on this issue further, and of course we will look into the PHP notices as well. In the meantime, could you please confirm that you are using PHP 7.2.0?

    Thank you for your understanding!

    Best Regards,
    John | Kreatura Dev Team

  • Andis replied

    Hi John,

    Yes, you are correct. The production server is running PHP 7.2.0, while I'm running the site on PHP 7.1 in my development environment.

    I had a suspicion that PHP 7.2 might cause some issues. Unfortunately the production server is not managed by me so I can't do much to fix the issue. However, I'll notify the owner and administrator of the server.

    Thank you for swift answer!

    Best regards,
    Andy

  • Andis replied

    I think I found the culprit in LayerSlider/includes/slider_markup_setup.php on line 8:

    $slider = array();

    And code in slider_markup_html.php then tries to use $slider on line 61:

    if(!empty($slider['slides']) && is_array($slider['slides'])) {

    It is not empty but it does not contain the original data from LS_Shortcode::generateSliderMarkup()

  •  73
    John replied

    That's strange. Thank you for your feedback, Andis! We will look into this as soon as possible and release a fix if there is anything wrong on our side. 

    Best Regards,
    John | Kreatura Dev Team

  • Andis replied

    I have an update on this issue. It seems to be caused by Zend Opcache.

    I was getting occasional PHP Warning messages when running on PHP 7.2:

    PHP Warning:  Narrowing occurred during type inference. Please file a bug report on bugs.php.net in /var/www/[redacted]/wp-content/plugins/LayerSlider/layerslider.php on line 61

    It seemed strange because the line contains only an include statement. I decided to research the warning message and I found two bug reports on PHP bug tracker regarding opcache package:
    https://bugs.php.net/bug.php?id=74980
    https://bugs.php.net/bug.php?id=75570

    Both issues have been fixed but that tipped me off and I tried disabling OPcache to see if it helps. Sure enough the slider started to function correctly .

    I hope this helps to narrow down and reproduce the issue.

    I'm wondering if this should be reported as new opcache bug on PHP bug tracker.

  •  73
    John replied

    Hi Andis,

    Thank you very much for your feedback. 

    We've concluded the same. It's unfortunately an issue with PHP itself, and not LayerSlider. A couple of days ago PHP 7.2.1 was released and based on their changelog this issue should be fixed now. The only solution is to use a PHP version that is unaffected. The new release should be fine, but you might also want to consider downgrading if it's not.

    Best Regards,
    John | Kreatura Dev Team