• Resolved KZeni

    (@kzeni)


    Simply put, the commas at the end of a list/array of items is generally not problematic (though a bit unnecessary), but PHP 7.2 for some odd reason made it so having that trailing comma at then end of the parameters when calling a function causes a 500 server error. This recent release of Cool Timeline today had one occurrence of that which is breaking things site-wide for any site that happens to be on PHP 7.2.x. (with this plugin currently stating PHP version compliance of 5.6 and above so some sites might be set to auto-update with it having no reason to suspect there’d be an issue when it causes a full-site server error.)

    Thankfully it’s a quick & easy fix as the only thing that needs to be done is edit includes/shortcode-blocks/ctl-block.php so that:

    $shortcode = sprintf(
    	$shortcode_string,
    	$layout,
    	$skin,
    	$showpost,
    	$dateformat,
    	$icons,
    	$animation,
    	$order,
    	$storycontent,
    );

    becomes:

    $shortcode = sprintf(
    	$shortcode_string,
    	$layout,
    	$skin,
    	$showpost,
    	$dateformat,
    	$icons,
    	$animation,
    	$order,
    	$storycontent
    );

    (notice how it’s just a matter of removing the unnecessary trailing comma in the list of parameters when sprintf is being called within ctl_block_callback.)

    Hopefully, this can be fixed & released as an updated version sooner than later so fewer sites using this plugin on PHP 7.2 encounter the site-wide error that’d otherwise come up with the recent update. Also, this is one aspect to be mindful of for future updates unless the new release simply increases the required PHP version of the plugin to be PHP 7.3 and newer or something to not have to worry about it as I believe this problem really only affected PHP 7.2.x.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter KZeni

    (@kzeni)

    As an complete aside, I looked around for a possible GitHub repo (or similar) for this plugin to help propose this patch in a more structured way to help facilitate this being patched and found https://github.com/narinder9/cool-timeline. However, this doesn’t look to have been updated in a couple months (still on version 2.7.1.)

    I’d love to see more & more plugins having an active presence on GitHub for better community involvement for fixes/updates/etc. If that repo does get updated to be up-to-date, I’d love to see it linked to from the plugin’s description so more people know about it to use it accordingly (it can also be somewhat of a factor when deciding to use a plugin or not as it’s good to see a plugin can more formally/adequately accept proposed updates from its community, helps point people right to it rather than having them needing to search themselves to then potentially find a fork or some other non-official repo for the plugin, can see how up-to-date the repo is, can also offer another way to get a list of past releases [a currently untapped offering for the current repo; might be nice to start adding releases there alongside WP.org now rather than never], etc.)

    Again, complete aside from the larger issue at hand, but I figured it might be nice to do at some point for situations like this where there’s a clear bug that only part of the community would encounter (or if it’s a larger issue and/or simply a proposed update/improvement) for them to identify & propose a patch for.

    I’m having the same problem with PHP 7.0.33 … hopefully they add your quick fix to the next update .

    Plugin Support aniketji

    (@aniketji)

    Hi @kzeni & @kharzbh,

    Thanks for the update and sorry for encountering this issue.

    We will test it with older PHP version and fix all PHP errors and update the plugin as soon as possible.

    Thanks & Regards

    Plugin Support aniketji

    (@aniketji)

    Hi @kzeni & @kharzbh,

    We have updated the plugin and fixed the PHP fatal error issue, please update your plugin to the latest version of our Cool Timeline Plugin v2.8.2.

    Thanks & Regards.

    Thanks for the quick fix… I tested it and no more errors , everything is working fine .

    • This reply was modified 11 months, 2 weeks ago by kharzbh.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Proposed Bug Fix: PHP compatibility issue causing fatal error in recent release’ is closed to new replies.