Hi. This problem is related to:
Problem description:
I took the pkp OJS test import file here:
which works just fine on the import.
I replaced the submission_file/file/embed tag with href tag
(example: <href src="https://hcmc.uvic.ca/~mholmes/ojs/christensen_1_15.pdf" mime_type="application/pdf"/>).
In the file tag I removed the filesize attribute and changed the @extension to .pdf
When running an import I get the error below. It seems href file imports do not work.
[19-Nov-2021 15:24:53 America/Edmonton] PHP Notice: Undefined variable: newFileId in /var/www/sites/scancan/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFileFilter.inc.php on line 338
[19-Nov-2021 15:24:53 America/Edmonton] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (jrnl_scancan
.submission_files
, CONSTRAINT submission_files_file_id_foreign
FOREIGN KEY (file_id
) REFERENCES files
(file_id
)) in /var/www/sites/scancan/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
Stack trace:
#0 /var/www/sites/scancan/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL)
#1 /var/www/sites/scancan/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(464): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /var/www/sites/scancan/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database{closure}(‘insert into `su…’, Array)
#3 /var/www/sites/scancan/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection- in /var/www/sites/scancan/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671