PHP error in 13.1.0 with BxTimelineDb.php linked to Timeline settings

I was playing around with a test install weeks ago and ran into a problem where I could not edit posts. On that server, I temporarily fixed it by making the Timeline module inactive and then active again. I have moved on to a new install using 13.1.0 on a new server. Today, I ran into the same problem of the post (update) edit function not working and leading to a forever spinner. This happened after I submitted one test post using Quill's video button for a YouTube link and one post using its HTML button to add a video embed code. I checked the error log in FASTPANEL. I am using Ubuntu 22.04 with PHP 8.1. The log states the error as the following (Edited for privacy. I also had to change web-links due to a message on here saying that Standard members can't post links.):

[error] 357990#357990: *5078 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined array key "bx_timeline_photos" in /var/www/EXAMPLE_site/data/www/EXAMPLE_site/modules/boonex/timeline/classes/BxTimelineDb.php on line 263PHP message: PHP Warning:  Undefined array key "bx_timeline_photos" in /var/www/EXAMPLE_site/data/www/EXAMPLE_site/modules/boonex/timeline/classes/BxTimelineDb.php on line 264" while reading response header from upstream, client: 000.00.000.00, server: EXAMPLE_site, request: "POST /m/timeline/get_edit_form/3/ HTTP/1.1", upstream: "fastcgi**:**/**/unix:/var/run/EXAMPLE_site.sock:", host: "EXAMPLE_site", referrer: "htt*p**s*:*/*/*EXAMPLE*.*com/"

I used my SSH program to track down the file and see what it is referring to. Here is the relevant code:

    public function getMedia($sType, $iEventId, $iOffset = 0, $bFullInfo = false)
    {
        $sTableMedia = $this->_aTablesMedia[$sType];
        $sTableMedia2Events = $this->_aTablesMedia2Events[$sType];

        $sMethod = 'getColumn';
        $sSelectClause = "`tme`.`media_id` AS `id`";
        if($bFullInfo) {
            $sMethod = 'getAll';
            $sSelectClause = "`tm`.*, `tme`.`event_id` AS `event_id`";
        }

        $sLimitAddon = '';
        if($iOffset != 0)
            $sLimitAddon = $this->prepareAsString(" OFFSET ?", $iOffset);

        $sQuery = $this->prepare("SELECT " . $sSelectClause . "
            FROM `" . $sTableMedia2Events . "` AS `tme`
            LEFT JOIN `" . $sTableMedia . "` AS `tm` ON `tme`.`media_id`=`tm`.`id`
            WHERE `tme`.`event_id`=?" . $sLimitAddon, $iEventId);

        return $this->$sMethod($sQuery);
    }

After checking likely culprits, I fixed the problem by shutting off the "Treat images inserted in the editor as attachments" and "Enable priority of media content over links in attachments" options in Timeline settings and clearing the cache. That's all I know, but I figured it might help someone to post this info.

  • 822
  • More
Replies (0)
Login or Join to comment.