It seems like you have an entry in your tables for a nonexistent article. Check e.g. to make sure that the article_id column in article_supplementary_files always refers to an existing article.
Regards,
Alec Smecher
Public Knowledge Project Team
We added one more command to our âpre upgrade scriptâ: delete from article_supplementary_files where article_id not in (select article_id from articles);
@asmecher The error persists even after running the following commands:
delete from article_supplementary_files where article_id not in (select article_id from articles);
delete from article_files where article_id not in (select article_id from articles);
delete from article_settings where article_id not in (select article_id from articles);
delete from submission_files where submission_id not in (select submission_id from submissions);
delete from submission_settings where submission_id not in (select submission_id from submissions);
Do you have both articles and submissions in your database? Your OJS 2.x database should only have articles, and after upgrade, your OJS 3.x database should only have submissions. If you have both, make sure youâre dropping your database, re-creating it empty, and then reloading from backup before you run the upgrade script again.
Regards,
Alec Smecher
Public Knowledge Project Team
I checked in my database from the error reported in my log:
SELECT * FROM genre_settings WHERE genre_id = '1896'
-----<hr>
-----<hr>
(mysql): SELECT DISTINCT
sf.file_id AS submission_file_id, sf.revision AS submission_revision,
af.file_id AS artwork_file_id, af.revision AS artwork_revision,
suf.file_id AS supplementary_file_id, suf.revision AS supplementary_revision,
s.locale AS submission_locale,
sf.*, af.*, suf.*
FROM submission_files sf
LEFT JOIN submission_artwork_files af ON sf.file_id = af.file_id AND sf.revision = af.revision
LEFT JOIN submission_supplementary_files suf ON sf.file_id = suf.file_id AND sf.revision = suf.revision
LEFT JOIN submissions s ON s.submission_id = sf.submission_id WHERE sf.file_id = 357157 ORDER BY sf.submission_id ASC, sf.file_stage ASC, sf.file_id ASC, sf.revision DESC
-----<hr>
-----<hr>
(mysql): SELECT * FROM submission_file_settings WHERE file_id = '357157'
-----<hr>
PHP Fatal error: Call to a member function getStatus() on null in ojs/classes/install/Upgrade.inc.php on line 1369
Fatal error: Call to a member function getStatus() on null in ojs/classes/install/Upgrade.inc.php on line 1369
The error occurred due to the existence of null value records in the âsection_idâ field of the OJS 2.4.8-3 âarticlesâ table. The update ran correctly after correcting this problem.
The solution for this issue was to look at the tables âarticlesâ and âsubmissionsâ for records with section_id=null or section_id=0. Then, after fixing the articlesâ sections (or simply deleting them), the upgrade process passed this point.
What is âexisting articleâ? When an article is deleted (in OJS 2, by clicking in as Journal Editor, and clicking to Archives and deleting from there; not just removing from any issues), the software keeps a record of that article. Thatâs to allow tombstones in OAI-PMH, and keep a record that it existed maybe in case of anyone wanting to check on submissions as a whole.
If an article has been deleted from OJS 2, then would that cause this same problem? If so, how can the problem be fixed?
When you delete an article, it does leave a tombstone â but it should be fully removed from the articles table and other related tables (e.g. article_supplementary_files).
Regards,
Alec Smecher
Public Knowledge Project Team
What log file were you using to find out the upgrade error report? Did you use any argument in command line to get it log with detail information when you run upgrade.php? At least if I also want error report being logged, what shall I do?
Hi Liang, you need to activate log in your config.inc.php (ojs)
; Enable database debug output (very verbose!)
debug = On
; Display execution stats in the footer
show_stats = On
; Display a stack trace when a fatal error occurs.
; Note that this may expose private information and should be disabled
; for any production system.
show_stacktrace = On
; Display an error message when something goes wrong.
display_errors = On
If you are running in a virtual machine or with connection by ssh, maybe you need to use ânohupâ command:
I have one article with a NULL section_id where I canât get to it through the web interface. So, I go to the journal itâs in, and then I try to pull it up from âEditorâ âArchivesâ or directly by URL like domainhere/journalcodehere/editor/submission/articlenumberhere and I canât get to it.
In this case, how can I handle this one article?
Directly in the database, delete the row from the articles table?
Directly in the database, change the section_id to match the section_id of any other article within the same journal?
What is a way to handle this without causing a data integrity problem?