Error on OAI-PMH Harvester module

Hi,

We are testing OAI-PMH Harvester module because we need to import in our repository data collected from other repository using OAI protocol, but when we harvest the data using the OAI-PMH Harvester module we get the following error:

Fatal error: Uncaught TypeError: strlen() expects parameter 1 to be string, integer given in /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php:136
Stack trace:
#0 /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php(136): strlen(2)
#1 /var/www/html/omeka-s/application/src/Job/DispatchStrategy/Synchronous.php(34): OaiPmhHarvester\Job\Harvest->perform()
#2 /var/www/html/omeka-s/application/src/Job/Dispatcher.php(105): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#3 /var/www/html/omeka-s/application/data/scripts/perform-job.php(44): Omeka\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#4 {main}
  thrown
in /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php on line 136

Has anyone encountered the same problem? Any idea about why are we getting this error?

Thanks in advance for your help!

I don’t know the version you use, but if it is my fork (that is not a fork but a fix for pull request), I fixed it in version 3.3.0.8 (see https://github.com/Daniel-KM/Omeka-S-module-OaiPmhHarvester).

Hi Daniel,

Thanks for your answer. I was using version 3.3.0.7 that I downloaded last week. Sorry, I was not aware of a new version was published.
I have tested the new version and now I get a different error:

Fatal error: Uncaught TypeError: trim() expects parameter 1 to be string, object given in /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php:342
Stack trace:
#0 /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php(342): trim(Object(SimpleXMLElement))
#1 /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php(327): OaiPmhHarvester\Job\Harvest->extractValues(Object(SimpleXMLElement), 1)
#2 /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php(192): OaiPmhHarvester\Job\Harvest->_anyDctermsToJson(Object(SimpleXMLElement), 45)
#3 /var/www/html/omeka-s/application/src/Job/DispatchStrategy/Synchronous.php(34): OaiPmhHarvester\Job\Harvest->perform()
#4 /var/www/html/omeka-s/application/src/Job/Dispatcher.php(105): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#5 /var/www/html/omeka-s/application/data/scripts/perform-job.php(44): Omeka\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#6 {main}
  thrown
in /var/www/html/omeka-s/modules/OaiPmhHarvester/src/Job/Harvest.php on line 342

Do you know the cause of this error?

Thanks again.

I fixed it for your issue.

Your second issue too, you may need to reload the master.

Wow! You are very quick solving the issues. Thank you very much!
I have tested the last version and it works fine. Now that I have been able to import some registers, I will continue validating the module functionality.
Again, Thanks!