• Resolved charlesgodwin

    (@charlesgodwin)


    We are getting this error when running Version 2.5 of the free version.

    PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /home/ogsonca/public_html/wp-content/plugins/cool-timeline/includes/ctl-helper-functions.php:52

    We are running this on a multisite, in one site only, with PHP version 8.1.14

    Here is the short code.

    [cool-timeline layout="default" skin="default" show-posts="25" order="DESC" icons="YES"]

    This used to work with a version 1.5 of Cool-timeline pro from 2016. But that version is generating lots of these warnings Trying to access array offset on value of type bool and needed to be replaced.

    What do you suggest. We have disabled the plugin for now.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Jyoti Bhandari

    (@jyoti197)

    Hi @charlesgodwin,

    Sorry for the delay in response. Actually I have checked our plugin in multisite but no such issue found.

    Please replace line no. 52 with below shared code:-

    $ctl_story_date = isset($ctl_story_type[‘ctl_story_date’])?$ctl_story_type[‘ctl_story_date’]:”;

    and line no. 53 with below shared code :-

    if (!empty($ctl_story_date)) {

    If you are facing this issue again, please elaborate a little bit more with the help of the screenshot so I can take a closer look.

    Thanks & Regards


    Thread Starter charlesgodwin

    (@charlesgodwin)

    I got it working with one more change.

    I am using PHP 8.1, that may explain the differences.

    $ctl_story_type = get_post_meta($post_id, '', true); @ line 51 is returning an array of arrays. See the print_r output below.

    I modified line 53 to this:(I added [0])
    $ctl_story_date = isset($ctl_story_type[‘ctl_story_date’])?$ctl_story_type[‘ctl_story_date’][0]:”;

     error_log(print_r($ctl_story_type, true));
    [20-Jan-2023 13:32:16 UTC] Array
    (
        [_edit_last] => Array
            (
                [0] => 1
            )
    
        [_edit_lock] => Array
            (
                [0] => 1507998950:1
            )
    
        [ctl_story_year] => Array
            (
                [0] => 1938
            )
    
        [ctl_story_date] => Array
            (
                [0] => 10/14/2017 12:38
            )
    
        [story_format] => Array
            (
                [0] => default
            )
    
        [img_cont_size] => Array
            (
                [0] => full
            )
    
        [fa_field_icon] => Array
            (
                [0] =>
            )
    
        [tc-thumb-fld] => Array
            (
                [0] => a:2:{s:9:"_thumb_id";b:0;s:11:"_thumb_type";s:10:"attachment";}
            )
    
        [ctl_story_timestamp] => Array
            (
                [0] => 201710141238
            )
    )
    • This reply was modified 2 years, 2 months ago by charlesgodwin.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘UnCaught Type Error’ is closed to new replies.