Here are some test instructions Fresh install Login as admin Create group - Group X - set allow submissions = yes - set archive submissions = yes
Create 2 users A and B Add them to group X as members Login in as A Make page Add comment block to page Share page with B Login as B Comment on page Login in as A Submit page to group X Login as Admin Release the page Run cron via the command line sudo -u www-data php htdocs/lib/cron.php See [Error]: Call to a member function get() on null at /home/robertl/code/mahara/htdocs/artefact/comment/blocktype/comment/lib.php:111 In Admin -> People -> Export queue re-queue the failed item In database remove the lock delete from config where field like '\_%'; update cron set nextrun = null where callfunction = 'export_process_queue'; Checkout patch Run cron via the command line sudo -u www-data php htdocs/lib/cron.php Cron completes Check that it has gone from the queue and is now in Admin -> Groups -> Archived submissions -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: mahara-contributors https://bugs.launchpad.net/bugs/1912705 Title: Task "export_process_queue" fails on cron run Status in Mahara: Confirmed Status in Mahara 20.10 series: Confirmed Status in Mahara 21.04 series: Confirmed Status in Mahara 21.10 series: In Progress Bug description: When submissions are set to be archived before being released back to the submitter, they are queued for export and an archived version is created. This processed failed for us and we were given a hint in the cron logs/output that the error was thrown at `htdocs/artefact/comment/blocktype/comment/lib.php:111`. Adding a `debug_print_backtrace()` to the file reveals more in the cron output: ``` [INF] 35 (lib/cron.php:190) Running core cron export_process_queue #0 PluginBlocktypeComment::render_instance_export(BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated] , html) called at [<siteroot>/mahara/htdocs/lib/mahara.php:1818] #1 call_static_method(PluginBlocktypeComment, render_instance_export, BlockInstance Object ([BlockInstanceid] => 320133,[BlockInstanceblocktype] => comment,[BlockInst............[truncated] , html) called at [<siteroot>/mahara/htdocs/blocktype/lib.php:1351] #2 BlockInstance->render_viewing(html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2290] #3 View->build_column(3, 1, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2241] #4 View->build_columns(3, , html, ) called at [<siteroot>/mahara/htdocs/lib/view.php:2182] #5 View->build_rows(, html) called at [<siteroot>/mahara/htdocs/export/html/lib.php:479] #6 PluginExportHtml->dump_view_export_data() called at [<siteroot>/mahara/htdocs/export/html/lib.php:242] #7 PluginExportHtml->export() called at [<siteroot>/mahara/htdocs/export/lib.php:1015] #8 PluginExportAll->export() called at [<siteroot>/mahara/htdocs/export/lib.php:704] #9 export_process_queue() called at [<siteroot>/mahara/htdocs/lib/cron.php:198] [WAR] 35 (lib/errors.php:536) [Error]: Call to a member function get() on null at <siteroot>/mahara/htdocs/artefact/comment/blocktype/comment/lib.php:112 Call stack (most recent first): * exception(object(Error)) at Unknown:0 A nonrecoverable error occurred. This probably means you have encountered a bug in the system ``` We were able to fix it by explicitly declaring `global $exporter;` in `htdocs/export/lib.php:602` at the very start of the `export_process_queue` function - please refer to attached patch. It also affects portfolio exports when the "Export to queue" settings is enabled in Configure site > Site options > Account settings. ------------------------------ Application/System version(s): Mahara $config->version = 2020013013; $config->series = '20.04'; $config->release = '20.04.2'; OS Ubuntu 18.04.5 LTS DB MySQL 5.7 ------------------------------ To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1912705/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

