Custom reports generator interface not loading

Hi, I’m running 2.4.7-1 and when I click on the generate custom report link it goes to the page and loads pretty much all the elements (header footer, etc) just the reports interface is missing - in it’s place it says “Loading …” See below of an error that shows up in my apache error log. All the other stats run fine, it’s just the custom reports interface. If someone can point me in a direction to help fix this issue, it would be greatly appreciated.

ojs2 has produced an error
Message: WARNING: call_user_func_array() expects parameter 1 to be a valid callback, class ‘PKPComponentRouter’ does not have a method ‘getRequestedPage’
In file: {REMOVED}/lib/pkp/classes/core/PKPRequest.inc.php
At line: 833
Stacktrace:
Server info: OS: Linux
PHP Version: 5.6.14-0+deb8u1
Apache Version: Apache/2.4.10 (Debian)
DB Driver: mysql
DB server version: 5.5.46-0+deb8u1

See [OJS] COMPONENT_ROUTER_PATHINFO_MARKER request raises error in Request::getRequestedPage() · Issue #336 · pkp/pkp-lib · GitHub and pkp/pkp-lib#336 Fix missing check for request type by asmecher · Pull Request #606 · pkp/ojs · GitHub.

There is probably another generic plugin enabled which exhibits this faulty behavior.

What generic plugins do you have enabled?

Can you try enabling show_stacktrace

and post the results from the error log?

Thanks so much for reaching out Clinton. After turning on stacktrace, my issue looked very similar, the only difference the Thesis Feed plugin was the culprit. Based on the changes you guys made to the Announcement feed, I made similar changes to the Thesis feed. After the changes, I now see no Apache errors with stacktrace on, unfortunately the custom reports generator page still says loading.

Generic Plugins Running
Coins
TinyMCE
Thesis Abstracts Feed
Weeb Feed
Custom Block Manager
GA
Acron
Usage Event
Usage Statistics
PDF.JS PDF Viewer

Any direction you can provide from here?
Thanks,

  • Jim

For good measure here was the stacktrace before I made the changes to the Thesis plugin:

ojs2 has produced an error
Message: WARNING: call_user_func_array() expects parameter 1 to be a valid callback, class ‘PKPComponentRouter’ does not have a method ‘getRequestedPage’
In file: {removed}/lib/pkp/classes/core/PKPRequest.inc.php
At line: 833
Stacktrace:
File: (unknown) line (unknown)
Function: PKPApplication->errorHandler(2, “call_user_func_array() expects parameter 1 to be a valid callback, class ‘PKPComponentRouter’ does not have a method ‘getRequestedPage’”, “{removed}/lib/pkp/classes/core/PKPRequest.inc.php”, 833, Array(5))
File: {removed}/lib/pkp/classes/core/PKPRequest.inc.php line 833
Function: call_user_func_array(Array(2), Array(1))
File: {removed}/lib/pkp/classes/core/PKPRequest.inc.php line 727
Function: PKPRequest->_delegateToRouter(“getRequestedPage”)
File: {removed}/plugins/generic/thesisFeed/ThesisFeedPlugin.inc.php line 81
Function: PKPRequest->getRequestedPage()
File: (unknown) line (unknown)
Function: ThesisFeedPlugin->callbackAddLinks(“TemplateManager::display”, Array(5))
File: {removed}/lib/pkp/classes/plugins/HookRegistry.inc.php line 89
Function: call_user_func(Array(2), “TemplateManager::display”, Array(5))
File: {removed}/lib/pkp/classes/template/PKPTemplateManager.inc.php line 332
Function: HookRegistry->call(“TemplateManager::display”, Array(5))
File: {removed}/lib/pkp/classes/form/Form.inc.php line 190
Function: PKPTemplateManager->display(“controllers/statistics/form/reportGeneratorForm.tpl”, Null, Null, False)
File: {removed}/controllers/statistics/form/ReportGeneratorForm.inc.php line 211
Function: Form->fetch(Object(Request))
File: {removed}/controllers/statistics/ReportGeneratorHandler.inc.php line 40
Function: ReportGeneratorForm->fetch(Object(Request))
File: (unknown) line (unknown)
Function: ReportGeneratorHandler->fetchReportGenerator(Array(0), Object(Request))
File: {removed}/lib/pkp/classes/core/PKPRouter.inc.php line 362
Function: call_user_func(Array(2), Array(0), Object(Request))
File: {removed}/lib/pkp/classes/core/PKPComponentRouter.inc.php line 246
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(0))
File: {removed}/lib/pkp/classes/core/Dispatcher.inc.php line 129
Function: PKPComponentRouter->route(Object(Request))
File: {removed}/lib/pkp/classes/core/PKPApplication.inc.php line 178
Function: Dispatcher->dispatch(Object(Request))
File: {removed}/index.php line 64
Function: PKPApplication->execute()
Server info:
OS: Linux\n PHP Version: 5.6.14-0+deb8u1
Apache Version: Apache/2.4.10 (Debian)
DB Driver: mysql
DB server version: 5.5.46-0+deb8u1, referer: {removed}/manager/reportGenerator

I’ve confirmed the ThesisFeedPlugin problem and posted a fix: ThesisFeedPlugin is missing request type check · Issue #897 · pkp/pkp-lib · GitHub

You seem fairly savvy. If you are able to use the browser’s Web Inspector tool, you can watch the network traffic when requesting (or reloading) the journal’s reportGenerator page. One of the requests will be for “…/$$$call$$$/statistics/report-generator/fetch-report-generator”. The response of this request should look like a JSON object:

{"status":true,"content":"<script type=\"text\/javascript\">\n\t$(function() {\n\t\t\/\/ Attach the form
 handler.\n\t\t$('#reportGeneratorForm').pkpHandler('$.pkp.statistics.ReportGeneratorFormHandler',\n
\t\t\t{\n\t\t\t\tfetchFormUrl: ...

It will likely instead contain the error message that is still causing the problem.

Hey Clinton, thanks for direction on this problem. When I checked the response data, there was no error. It was strange because in the response window it seemed as the data was being loaded, it just wan’t presenting the data on the web page. I noticed at the bottom of the response data a code snippet we added to the index.php file a few years back. I wondered if that was causing the data not to display on the webpage. Once I pulled the code out of the index.php file and reran the custom generator page, the data popped right up. I’m all set, thanks for all the help on this!

  • Jim