collectiveaccess / providence

Cataloguing and data/media management application
GNU General Public License v3.0
295 stars 167 forks source link

Subsequent batch edits in the same task queue run fail #1588

Open kehh opened 3 months ago

kehh commented 3 months ago

We're seeing an issue where if you have multiple batch edits in a task queue run, subsequent batch edits don't apply. We've seen this by trying to replace object preferred labels. It appears that the subsequent runs $vs_screen = $po_request->getActionExtra(); results in an empty screen in \BatchProcessor::saveBatchEditorForm().

We've managed to fix the issue by unsetting the global $g_app_controller inside app/lib/Plugins/TaskQueueHandlers/batchEditor.php just prior to calling AppController::getInstance()

This is running off of develop.

Obviously AppController is a pretty central class so I didn't want to just change it as a work around, so wanted some thoughts on a fix for this @collectiveaccess?

We've seen that both mediaImport.php and metadataImport.php take a similar approach so may also be affected by this.

So do we want to:

  1. Clear the instance when running each task in the task queue inside \TaskQueue::processQueue
  2. Add a parameter to AppController::getInstance to clear existing
  3. Add a separate method to AppController to clear the existing instance
  4. Some combination of the above
collectiveaccess commented 3 months ago

Please evaluate this on dev/php8. We're not working on develop at this point.

collectiveaccess commented 2 months ago

Push a fix for this on dev/php8.