2.4.6 fatal error after update

I’ve had updated my ojs version from 2.3.7 to 2.4.6. and I get this error:
Fatal error: Call to a member function getJournal() on a non-object in /opt/ojs/classes/payment/ojs/OJSPaymentManager.inc.php on line 46
I can’t fix it. Can anybody help me?

Hi @MIRIAM_PUENTE_GARCIA,

Can you turn the show_stacktrace option in your config.inc.php file on, then trigger the error again? You should receive more details. Post the details here and I’ll see what I can suggest.

Regards,
Alec Smecher
Public Knowledge Project Team

I did it but I din’t get anything else. Just the same error

Hi @MIRIAM_PUENTE_GARCIA,

What does the line with show_stacktrace look like in your config.inc.php file?

Regards,
Alec Smecher
Public Knowledge Project Team

; 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 = Off
show_stacktrace = On

Do you also still have display_errors = On ?

If I change display_errors from Off to On this is the error showed:

NOTICE: Undefined property: OJSPaymentManager::$request (/opt/ojs_2.4.6_pruebas/classes/payment/ojs/OJSPaymentManager.inc.php:46)

Hi @MIRIAM_PUENTE_GARCIA,

What is the URL to the page where you receive that warning? (Feel free to remove the domain name; I just need the parts after the “index.php”.)

Regards,
Alec Smecher
Public Knowledge Project Team

http://revistaspruebas.unileon.es/index.php/artesmarciales

Sorry, I had the access restricted by ip but now is open.

Hi @MIRIAM_PUENTE_GARCIA,

In order to get a stack trace, try editing classes/payment/ojs/OJSPaymentManager.inc.php. Find line 46:

$journal =& $this->request->getJournal();

…and insert, before that line…

if (!isset($this->request)) fatalError('Request not set.');

This should cause a stack trace to be displayed when you view the page, which will help track down the problem.

Regards,
Alec Smecher
Public Knowledge Project Team

These are the errors now:

Request not set.

Stack Trace:

File: /opt/ojs_2.4.6_pruebas/classes/template/TemplateManager.inc.php line 112
Function: OJSPaymentManager->isConfigured()

File: /opt/ojs_2.4.6_pruebas/lib/pkp/classes/template/PKPTemplateManager.inc.php line 385
Function: TemplateManager->TemplateManager(Null)

File: /opt/ojs_2.4.6_pruebas/lib/pkp/classes/handler/PKPHandler.inc.php line 432
Function: PKPTemplateManager->getManager()

File: /opt/ojs_2.4.6_pruebas/pages/index/IndexHandler.inc.php line 34
Function: PKPHandler->setupTemplate()

File: (unknown) line (unknown)
Function: IndexHandler->index(Array(0), Object(Request))

File: /opt/ojs_2.4.6_pruebas/lib/pkp/classes/core/PKPRouter.inc.php line 362
Function: call_user_func(Array(2), Array(0), Object(Request))

File: /opt/ojs_2.4.6_pruebas/lib/pkp/classes/core/PKPPageRouter.inc.php line 220
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(0), False)

File: /opt/ojs_2.4.6_pruebas/lib/pkp/classes/core/Dispatcher.inc.php line 134
Function: PKPPageRouter->route(Object(Request))

File: /opt/ojs_2.4.6_pruebas/lib/pkp/classes/core/PKPApplication.inc.php line 178
Function: Dispatcher->dispatch(Object(Request))

File: /opt/ojs_2.4.6_pruebas/index.php line 64
Function: PKPApplication->execute()

Hi @MIRIAM_PUENTE_GARCIA,

OK, that helps. The error you’re hitting is strange, because it’s happening inside the TemplateManager constructor function, below where the PKPTemplateManager construction is called. In the PKPTemplateManager constructor, the request object is sure to be available:

if (!isset($request)) {
    $this->request =& Registry::get('request');
} else {
    $this->request =& $request;
}
assert(is_a($this->request, 'PKPRequest'));

…but in the error you report it is no longer set.

I suspect some of your OJS 2.3.x code is still mixed into your 2.4.x installation; I’d suggest starting with a fresh copy of the OJS 2.4.x code and comparing it with your installation (e.g. using diff) to see if there are any accidental changes.

Regards,
Alec Smecher
Public Knowledge Project Team