Bulk edit: set language for second value

Edit: basically the logic of what I’m trying to do is:

if any of <item[dcterms:title].@langauge> is null: 
    set item[dcterms:title].@langauge == 'en'

How do I do that within the UI tools of Omeka?


Hi all - I have a set of 5000+ items in my Omeka S installation. Each item has a first title value in some language, and a second title value that was translated by the archive team to English from the original title.

Unfortunately, the archive team forgot to set the language code on the translated title (dcterms:title[1]), so I want to set the language programmatically.

I tried to do so using the BulkEdit module: Advanced bulk edit > Cleaning > Normalize or modify language codes, with the following parameters:

{
  "clean_language_codes": {
    "from": "",
    "to": "en",
    "properties": [
      "dcterms:title"
    ]
  }
}

I’m using the above method since none of the bulk edit tools allow me to target the which of the value of a property to edit. Luckily all my 0th values are set, and none of my 1st values are.

But that gave me the following error from the logs:

Error: Call to a member function executeQuery() on null in /var/www/html/modules/BulkEdit/src/Mvc/Controller/Plugin/CleanLanguageCodes.php:128
Stack trace:
#0 /var/www/html/modules/BulkEdit/src/Mvc/Controller/Plugin/CleanLanguageCodes.php(103): BulkEdit\Mvc\Controller\Plugin\CleanLanguageCodes->getPropertyIds()
#1 /var/www/html/modules/BulkEdit/src/Mvc/Controller/Plugin/CleanLanguageCodes.php(79): BulkEdit\Mvc\Controller\Plugin\CleanLanguageCodes->checkPropertyIds(Array)
#2 /var/www/html/modules/BulkEdit/Module.php(690): BulkEdit\Mvc\Controller\Plugin\CleanLanguageCodes->__invoke(Array, '', 'en', Array)
#3 /var/www/html/modules/BulkEdit/Module.php(363): BulkEdit\Module->updateViaSql(Object(Omeka\Api\Adapter\ItemAdapter), Array, Array)
#4 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): BulkEdit\Module->handleResourceBatchUpdatePost(Object(Laminas\EventManager\Event))
#5 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(170): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\EventManager\Event))
#6 /var/www/html/application/src/Api/Manager.php(323): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\EventManager\Event))
#7 /var/www/html/application/src/Api/Manager.php(269): Omeka\Api\Manager->finalize(Object(Omeka\Api\Adapter\ItemAdapter), Object(Omeka\Api\Request), Object(Omeka\Api\Response))
#8 /var/www/html/application/src/Api/Manager.php(146): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#9 /var/www/html/application/src/Mvc/Controller/Plugin/Api.php(171): Omeka\Api\Manager->batchUpdate('items', Array, Array, Array)
#10 /var/www/html/application/src/Controller/Admin/ItemController.php(289): Omeka\Mvc\Controller\Plugin\Api->batchUpdate('items', Array, Array, Array)
#11 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ItemController->batchEditAction()
#12 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#13 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#14 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(103): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#15 /var/www/html/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#16 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#17 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#18 /var/www/html/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#19 /var/www/html/index.php(21): Laminas\Mvc\Application->run()
#20 {main}

Any thoughts on how to resolve this error?

As indicated on gitlab (where I can follow such type of issue better), it is fixed in the last version of the module.

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.