I'm doing an OAI migration, and running into problems in src/fetchers/Oaipmh.php.
The Fetcher assumes that the $identifier and $record_key are the same value, but they aren't necessarily.
If the item identifier contains special characters (e.g. oai:thisvancouver.vpl.ca:islandora_1910), MIK treats it differently in different contexts.
When writing the temporary metadata files: https://github.com/MarcusBarnes/mik/blob/master/src/fetchers/Oaipmh.php#L80-L82
Resulting filename: oai%3Athisvancouver.vpl.ca%3Aislandora_1910.metadata.
But the $record_key that is used everywhere else in the code looks like this: oai_thisvancouver.vpl.ca_islandora_1910.
So you end up with problems like this:
ErrorException.ERROR: ErrorException {"message":"file_get_contents(/Volumes/Arca/tmp/oaitest_temp/oai_thisvancouver.vpl.ca_islandora_410.metadata): failed to open stream: No such file or directory","code":{"record_key":"oai_thisvancouver.vpl.ca_islandora_1910","raw_metadata_path":"/Volumes/Arca/tmp/oaitest_temp/oai_thisvancouver.vpl.ca_islandora_1910.metadata","dom":"[object] (DOMDocument: {})"},"severity":2,"file":"/Users/brandon/sfuvault/mik/src/filegetters/OaipmhModsXpath.php","line":56} []
Because the filegetter is looking for $record_key.metadata, while the actual filename is $identifier.metadata. So it can't actually find the file.
So... how the heck do we fix this?
I'm doing an OAI migration, and running into problems in
src/fetchers/Oaipmh.php.The Fetcher assumes that the
$identifierand$record_keyare the same value, but they aren't necessarily.If the item identifier contains special characters (e.g.
oai:thisvancouver.vpl.ca:islandora_1910), MIK treats it differently in different contexts.When writing the temporary metadata files: https://github.com/MarcusBarnes/mik/blob/master/src/fetchers/Oaipmh.php#L80-L82
Resulting filename:
oai%3Athisvancouver.vpl.ca%3Aislandora_1910.metadata.But the
$record_keythat is used everywhere else in the code looks like this:oai_thisvancouver.vpl.ca_islandora_1910.So you end up with problems like this:
Because the filegetter is looking for
$record_key.metadata, while the actual filename is$identifier.metadata. So it can't actually find the file.So... how the heck do we fix this?