View Report fails with PHP Fatal error: Uncaught Error: Call to a member function getIssueIdentification() on null in /plugins/reports/views/ViewReportPlugin.inc.php:86

Hello Everyone,
Running the Report (View Reports) fails with the following error message. Any idea where I should be looking in the database tables? An SQL statement the can help identify the problem record will also help.

PHP Fatal error: Uncaught Error: Call to a member function getIssueIdentification() on null in /plugins/reports/views/ViewReportPlugin.inc.php:86\nStack trace:\n#0 /lib/pkp/pages/stats/PKPStatsHandler.inc.php(450): ViewReportPlugin->display()\n#1 /lib/pkp/pages/stats/PKPStatsHandler.inc.php(395): PKPStatsHandler->report()\n#2 /lib/pkp/classes/core/PKPRouter.inc.php(395): PKPStatsHandler->reports()\n#3 /lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()\n#4 /lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route()\n#5 /lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()\n#6 /index.php(68): PKPApplication->execute()\n#7 {main}\n thrown in /plugins/reports/views/ViewReportPlugin.inc.php on line 86

Hi @Nason_Bimbe,
What version of OJS are you using? Please include this in your posts.
Thank you,
Kate

Hello @kshuttle,

It is version 3.3.0.7. I just upgraded the application from 3.1.2.1

Nason

This sounds possibly like an orphaned submission still pointing to an issue that has since been deleted. You can probably try something like this in the database:

SELECT publication_id FROM publication_settings WHERE setting_name = ‘issueId’ AND setting_value NOT IN (SELECT DISTINCT issue_id FROM issues);

That’ll give you a list of the publications that are assigned to issues that don’t exist any more. From there you can look in the publications table to get the submissions they relate to, and go find them in the dashboard.

Best,
Jason

Thank @jnugent I will give it go.

Hi @jnugent, I did gave it a try but could not make the sense of it. The concept of publication and submission got me. While I was trying to resolve the problem another similar data problem was encountered and fortunately this new problem is well described at [OJS] PHP Warning and fatal error · Issue #6774 · pkp/pkp-lib · GitHub and a solution is provided by @asmecher which I used to resolve this particular issue.

I am now thinking my earlier problem is similar which may require a similar solution that is removing the orphaned rows from the database table. Could someone please craft SQL statement for me which would help me remove the row/s?

I am running version 3.3.0.7 which just got upgraded from 3.1.2.1

Hi @jnugent I have managed to pick out the problem publications as follows: -

Used the following query to identify the publications at least with better details for the administrator to find via the user interface.

SELECT * FROM ojskhulisa.publication_settings where publication_id IN (
SELECT publication_id FROM publication_settings WHERE setting_name = ‘issueId’ AND setting_value NOT IN (SELECT DISTINCT issue_id FROM issues)) ORDER BY publication_id;

Since we are running a multi journal installation, I used the following to identify the Contexts.

SELECT submission_id, context_id, current_publication_id, date_submitted from submissions WHERE current_publication_id IN (SELECT publication_id FROM publication_settings WHERE setting_name = ‘issueId’ AND setting_value NOT IN (SELECT DISTINCT issue_id FROM issues));

Many thanks for the steer.

Nason

Solved
Using the SQL statements I posted earlier

  • we were able to identify the problem publications (submissions)
  • we then unpublished them
    The View Report is now working fine

Nason