New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Error in loadExporterByCode() breaks download of object representations files in CA 2.0 #1557
Comments
Issue is still occuring with the latest code. I am not sure what exactly is supposed to be the exporter code. Can it be for example "XMP"? |
What does your |
|
Your latest commit fixed my issue, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In CA 2.0 (dev/php8), a PHP error occurs when trying to download object representations media files.
Fatal error: Uncaught TypeError: ca_data_exporters::exportRecord(): Argument #1 ($exporter_code) must be of type string, array given, called in /var/www/html/collectiveaccess/app/helpers/mediaPluginHelpers.php on line 902 and defined in /var/www/html/collectiveaccess/app/models/ca_data_exporters.php:1148
Stack trace:
#0 /var/www/html/collectiveaccess/app/helpers/mediaPluginHelpers.php(902): ca_data_exporters::exportRecord()
#1 /var/www/html/collectiveaccess/app/helpers/mediaPluginHelpers.php(827): caExportMediaMetadataForRecord()
#2 /var/www/html/collectiveaccess/app/lib/BaseEditorController.php(2548): caEmbedMediaMetadataIntoFile()
#3 /var/www/html/collectiveaccess/app/lib/Controller/RequestDispatcher.php(289): BaseEditorController->DownloadMedia() #4 /var/www/html/collectiveaccess/app/lib/Controller/AppController.php(108): RequestDispatcher->dispatch()
#5 /var/www/html/collectiveaccess/index.php(128): AppController->dispatch()
#6 {main} thrown in /var/www/html/collectiveaccess/app/models/ca_data_exporters.php on line 1148
This is due to an array passed to $ps_exporter_code which is expected to be a string in function loadExporterByCode() in app/models/ca_data_exporters.php.
This caused only a warning in PHP 7 but it became an error since PHP 8.
Here is some debug info that might be helpful:
json representation of $ps_exporter_code:
{"XMP:Title":{"ca_objects.preferred_labels.name":[]},"XMP:Description":{"ca_objects.description":[]},"XMP:Rights":["static:(c) 2011"],"XMP:Creator":{"ca_entities.preferred_labels.displayname":{"delimiter":","}},"XMP:Subjects":{"ca_list_items.preferred_labels.name_plural":{"delimiter":","}}}
The text was updated successfully, but these errors were encountered: