feed-me icon indicating copy to clipboard operation
feed-me copied to clipboard

Attempt to read property \"queue\" on bool - FeedsController.php: 111

Open anchovy opened this issue 2 years ago • 0 comments

Description

I've got a custom module that's generating a number of data files used in a feed-me import. i.e.

members.json
members.json.1
members.json.2
members.json.100

Rather than using pagination after the queue has run, I'm looking to see if there's another file to process, if there is renaming files to process renames the first file found to members.json and then programatically queues the feed to run again.

This was/is all working fine in craftcms/feed-me V4.4, but since upgrading to craftcms/feed-me V4.5.3 it's stopped working and now I'm getting the error in the feed me logs: Attempt to read property \"queue\" on bool - FeedsController.php: 111

The code I'm using for this is....

Event::on(Process::class, Process::EVENT_AFTER_PROCESS_FEED, function(FeedProcessEvent $event) {

            $feedUrl = $event->feed->feedUrl;
            $feedMefile = Craft::getAlias($feedUrl);

            //doesn't matter what - delete this file after processing.
            \craft\helpers\FileHelper::unlink($feedMefile);

            //testing we've more files.
            $allFeedFiles = \craft\helpers\FileHelper::findFiles(dirname($feedMefile),['only'=>[basename($feedMefile).'*']]);

            if(count($allFeedFiles) > 0)
            {

                //get the first file and rename it to the default file name & then trigger a re-run of feed me.
                rename($allFeedFiles[0],$feedMefile);

                //get the controller
                $feedMe = new \craft\feedme\console\controllers\FeedsController(false,false);

                //trigger feedme to re-run
                $feedMe->actionQueue($event->feed->id);

            }

})

Any ideas?

Additional info

  • Craft version: 3.7.44

  • PHP version: 8.0.8

  • Database driver & version: MySQL 8.0.27 --

  • Plugins & versions: Feed Me | 4.5.3

anchovy avatar Jun 16 '22 22:06 anchovy