How to Fix a Failed Article Report Export Feature in OJS ?

Fixing the failed Article Report error on your OJS 3 that caused error with getData() will be explained in this article on deep technical on solution to it. This article was inspired by feedback from a client who used our OJS Upgrade Service. The client initially requested an upgrade to protect their journal from OJS security breach or vulnerability in OJS and issues caused by an outdated OJS version.

Unfortunately, many OJS hosting providers do not include upgrade services—despite the fact that upgrading OJS is a complex, high-risk process that requires expert handling.

At OpenJournalTheme.com or OJT Team, we include OJS upgrade services, security patching, and expert technical support in all of our OJS hosting packages or dedicated OJS Support Service. With the OJT Team, your journal stays secure, up to date, and fully supported by professionals who specialize in OJS.

So Here is the Article Report error fixing the failed Article Report features that can be found in OJS. The failed Article Report Export features may not just caused by failure or inconsistent upgrade process, it also may caused by data anomaly in the database. This article may a bit technical, if you face similar issue, we recommend to be handled by technical person rather than you as the editor of OJS journal do this by yourself.

Before we move forward, please note that any damage to your database or anomaly in your OJS due to this article is not our responsibility. Remember your OJS is your responsibility.

Article Report OJS 3.4
Here how you can found Article Report features in OJS.

If you are a user of OJS version 3.4.0.1 to 3.4.0.8 and are experiencing Article Report error when exporting article reports, especially when an error like the following appears in the server log:

PHP Fatal error: Uncaught Error: Call to a member function getData() on null in plugins/reports/articles/ArticleReportPlugin.php on line 115

As a solution, you can follow this guide to fix the problem.

What causes this export article report to fail?

Based on a similar case on the Article Report error getData() as discussed in the following link:
https://forum.pkp.sfu.ca/t/php-fatal-error-uncaught-error-call-to-a-member-function-getdata-on-null-in-plugins-reports-articles-articlereportplugin-php-115/94878

We ran the suggested SQL command:

SELECT s.* FROM submissions s LEFT JOIN publications p ON (s.current_publication_id = p.publication_id) WHERE p.publication_id IS NULL;
ArticleReport

As a result, we found that one of the submissions has a current_publication_id with a null value. This is the data entry that causes the Article Report export process to fail or getData() with error output. Although we are not entirely certain what caused this current_publication_id to become null, our assumption is that it may have been due to an incomplete submission deletion process.

How to Fix Failed Article Report error ?

Option 1:

After running the previous SQL command and identifying entries with a null value, you can use the command below to delete the list of null data:

DELETE s FROM submissions s
LEFT JOIN publications p ON s.current_publication_id = p.publication_id
WHERE p.publication_id IS NULL;

However, please make sure to back up your database before executing this command. This action is irreversible and should be done with caution.


Option 2:

If you prefer not to modify or delete any data from your database, an alternative solution is to update the Article Report plugin code instead. Follow the steps below:

Navigate to your OJS installation directory and locate the following file:

public_html/plugins/reports/articles/ArticleReportPlugin.php

After that, please add the following code on line number 115:

if (!$publication) {
    continue;
}
Fix Article Report OJS Plugin

Between the two options above, we highly recommend using Option 2. This approach does not involve modifying or deleting any data from your database. Additionally, updating the code in the Article Report plugin provides a more sustainable solution. If a similar case arises in the future where a submission has its current_publication_id found with null data, the plugin will be able to export process without any errors.

Once you have implemented one of the options above, you can proceed to test the Article Report export feature to ensure that it is now working.

Conclusion

Actually we are not very sure why Article Report feature in OJS lead to this error that output getData. Although we have explained to our customer as we have data staging before the upgrade have been done, we also find the malformed data anomaly in the publication and submission relational table. To be honest, we convince that there actually bug in OJS that may cause such issue. However, currently we cannot track this bug and can only provide you with solution. So this bug or error in high chance may be emerged in the future.

We would like to thank to our client and PKP team that help us to tackle this issue that can be benefit to community not just for this client but with other client that face similar case.

If you need OJS expert team that help you handling for such kind of technical issue or need an OJS expert team (consist of OJS Expert Developer, Cyber Security team and OJS Operational Specialist) that have been trusted by lot of OJS user, consider to use or OJS Support Service or OJS Hosting service. So you can be focused on the improvement of your OJS journal rather than handling such complex issue.

About the Author
user-avatar

Hello! I'm Almadani, Customer support OJS from Openjournaltheme. Have a passion for helping solve publisher problems, have knowledge and experience related to the use of OJS, OMP and Eprints.

Leave a Comment

Your email address will not be published. Required fields are marked *

Need More Services  or Question?

Openjournaltheme.com started in 2016 by a passionate team that focused to provide affordable OJS, OMP,  OPS,  Dspace, Eprints products and services. Our mission to help publishers to be more focus on their content research rather than tackled by many technical OJS issues.

Under the legal company name :
Inovasi Informatik Sinergi Inc.

Secure Payment :

All the client’s financial account data is stored in the respective third-party site (such as Paypal, Wise and Direct Payment).
*Payment on Credit card can be done by request
Your financial account is guaranteed protection. We never keep any of the clients’ financial data.

Index