PHP Fatal error: Call to a member function getFileId() on null when attempting to upgrade 2.4.8.2 to 3.1.1.4

php v 5.6.38
When I attempt to upgrade my database on a test server I get the following issues/errors:

PHP Strict Standards: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /var/web/OJS311/ojs/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php on line 386
[pre-install]
[load: upgrade.xml]
[version: 3.1.1.4]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]

[code: Installer Installer::removeReviewEntries]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
PHP Strict Standards: Only variables should be assigned by reference in /var/web/OJS311/ojs/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122

[data: dbscripts/xml/upgrade/3.0.0_adaptTimedViews.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_adaptReferrals.xml]
PHP Strict Standards: Only variables should be assigned by reference in /var/web/OJS311/ojs/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/3.0.0_adaptBooksForReview.xml]
PHP Strict Standards: Only variables should be assigned by reference in /var/web/OJS311/ojs/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml]
PHP Strict Standards: Only variables should be assigned by reference in /var/web/OJS311/ojs/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml]
PHP Strict Standards: Only variables should be assigned by reference in /var/web/OJS311/ojs/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[schema: lib/pkp/xml/schema/common.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/log.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/announcements.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/scheduledTasks.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/metadata.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/reviews.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/reviewForms.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/controlledVocab.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/submissions.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/submissionFiles.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267

[schema: lib/pkp/xml/schema/notes.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/views.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/genres.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/tombstone.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/metrics.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/views.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/libraryFiles.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: lib/pkp/xml/schema/navigationMenus.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[schema: dbscripts/xml/ojs_schema.xml]
PHP Strict Standards: Only variables should be passed by reference in /var/web/OJS311/ojs/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::installDefaultNavigationMenus]

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]

[code: Installer Installer::migrateSRLocale]

[code: Installer Installer::migrateNOLocale]

[code: Installer Installer::concatenateIntoAbout]

[code: Installer Installer::concatenateIntoMasthead]

[code: Installer Installer::migrateCounterPluginUsageStatistics (skipped)]

[code: Installer Installer::migrateTimedViewsUsageStatistics (skipped)]

[code: Installer Installer::migrateDefaultUsageStatistics (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postCounterMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postTimedViewsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type.xml]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type_metrics.xml]
[data: dbscripts/xml/upgrade/3.0.0_settings.xml]

[code: Installer Installer::installDefaultGenres]

[code: Installer Installer::migrateArticleMetadata]
PHP Strict Standards: Declaration of SubmissionKeywordEntryDAO::getByControlledVocabId() should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in /var/web/OJS311/ojs/lib/pkp/classes/submission/SubmissionKeywordEntryDAO.inc.php on line 20
PHP Strict Standards: Declaration of SubmissionLanguageEntryDAO::getByControlledVocabId() should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in /var/web/OJS311/ojs/lib/pkp/classes/submission/SubmissionLanguageEntryDAO.inc.php on line 46
PHP Strict Standards: Declaration of SubmissionAgencyEntryDAO::getByControlledVocabId() should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in /var/web/OJS311/ojs/lib/pkp/classes/submission/SubmissionAgencyEntryDAO.inc.php on line 44
[data: dbscripts/xml/upgrade/3.0.0_update.xml]

[code: Installer Installer::clearDataCache]

[code: Installer Installer::migrateUserRoles]

[code: Installer Installer::fixReviewForms]

[code: Installer Installer::htmlifyEmailTemplates]
[note: docs/release-notes/README-BEACON]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]
[data: dbscripts/xml/upgrade/3.0.0_scheduledTasks.xml]

[code: Installer Installer::localizeCustomBlockSettings]

[code: Installer Installer::convertEditorDecisionNotes]

[code: Installer Installer::convertQueries]
PHP Strict Standards: Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in /var/web/OJS311/ojs/classes/article/SubmissionFileDAO.inc.php on line 23

[code: Installer Installer::migrateFiles]

Followed by LOTS of warnings similar to this:
WARNING: Unable to find a match for β€œ122-xx-xx-SM.html” in β€œ/var/web/OJSFiles/OJS311/files/journals/1//articles/122/”. Skipping this file.

[code: Installer Installer::convertSupplementaryFiles]
PHP Warning: copy(/var/web/OJSFiles/OJS311/files/journals/1//articles/15/attachment/15-1-98-1-13-20120514.zip): failed to open stream: No such file or directory in /var/web/OJS311/ojs/lib/pkp/classes/file/FileManager.inc.php on line 159
PHP Warning: assert(): Assertion failed in /var/web/OJS311/ojs/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 123
PHP Warning: copy(/var/web/OJSFiles/OJS311/files/journals/1//articles/14/attachment/14-1-55-1-13-20120129.doc): failed to open stream: No such file or directory in /var/web/OJS311/ojs/lib/pkp/classes/file/FileManager.inc.php on line 159
PHP Warning: assert(): Assertion failed in /var/web/OJS311/ojs/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 123
PHP Warning: assert(): Assertion failed in /var/web/OJS311/ojs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374

[code: Installer Installer::provideSupplementaryFilesForReview]
PHP Warning: copy(/var/web/OJSFiles/OJS311/files/journals/1//articles/14/submission/proof/14-12-55-1-10-20120129.doc): failed to open stream: No such file or directory in /var/web/OJS311/ojs/lib/pkp/classes/file/FileManager.inc.php on line 159
PHP Warning: assert(): Assertion failed in /var/web/OJS311/ojs/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 112
PHP Warning: copy(/var/web/OJSFiles/OJS311/files/journals/1//articles/14/submission/review/14-12–1-4-20120129.doc): failed to open stream: No such file or directory in /var/web/OJS311/ojs/lib/pkp/classes/file/FileManager.inc.php on line 159
PHP Fatal error: Call to a member function getFileId() on null in /var/web/OJS311/ojs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 1065

I had some old files that were bogus so I ran the following items to purge them before doing the update otherwise the upgrade would attempt to make false directories in the files directories:

DELETE a, c
FROM article_supplementary_files a
JOIN article_supp_file_settings c ON a.supp_id = c.supp_id
where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a from articles a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a from article_files a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a from article_comments a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a from article_galleys a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a, c
FROM article_search_objects a
JOIN article_search_object_keywords c ON a.object_id = c.object_id
where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’
;

DELETE a from article_settings a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a from edit_assignments a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a from edit_decisions a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

DELETE a from referrals a where a.article_id = β€˜5’
or a.article_id =β€˜13’
or a.article_id =β€˜17’
or a.article_id =β€˜26’
or a.article_id =β€˜30’
or a.article_id =β€˜43’;

I also ran SELECT * FROM articles a LEFT JOIN sections s ON (a.section_id = s.section_id) WHERE s.section_id IS NULL;

which gave me two article_id of 4 and 59 so I updated their section id’s

update articles set section_id = β€˜1’ where article_id = β€˜4’ or article_id =β€˜59’;

Any help would be appreciated.

Does anyone have a suggestion?

I guess I’ll try to go to 3.0.1 and then upgrade from there…

I upgraded to 3.0.1 and worked my way up to 3.1.1-4

1 Like

hawkpf,

Are any of your journals using embargos? We have this same error ( Fatal error: Call to a member function getFileId() on null in /var/www/ojs-3.1/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 1065 ), but I think that 3.0.1 did not support subscriptions and embargos and I worry about trying to go through some steps that are missing that functionality and messing up info on the embargos.

Thanks for any assistance.

And, if anyone knows an alternative way to deal with β€œFatal error: Call to a member function getFileId() on null in /var/www/ojs-3.1/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 1065”, I would be very grateful for pointers.

Cheers,

-Wilhelmina

Hi @randtke, please have a look at this thread for that error.