OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



OJSPaymentManager::getManager() in 2.4.2

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

OJSPaymentManager::getManager() in 2.4.2

Postby pixelandpen » Fri Aug 30, 2013 11:21 am

Hi there,

[Note: I recently upgraded from 2.3.8 to 2.4.2, as per my questions at viewtopic.php?f=8&t=10449]

According to viewtopic.php?f=8&t=10426 it looks like for 2.4.2 I am supposed to apply this patch http://pkp.sfu.ca/bugzilla/attachment.cgi?id=3728 to change the PaymentManager class constructor. However, when I do that, then most pages in my newly updated 2.4.2 ( was 2.3.8 ) come up as blank (because the respective calls to OJSPaymentManager's constructor fails, according to the Apache error logs).

It looks like in 2.4.2 that all calls to the OJSPaymentManager class constructor includes a 'request' parameter, so I'm unclear as to why the patch mentioned above should be used.

The main problem I have right now is that a user cannot create a new submission, as the /journalname/author/submit/ page appears as blank.

Please advise.

Thanks,

Graham
pixelandpen
 
Posts: 12
Joined: Thu Aug 29, 2013 6:10 am

Re: OJSPaymentManager::getManager() in 2.4.2

Postby asmecher » Fri Aug 30, 2013 11:38 am

Hi Graham,

What is the error message logged for the constructor calls after the patch is applied?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJSPaymentManager::getManager() in 2.4.2

Postby pixelandpen » Fri Aug 30, 2013 11:51 am

If I apply the patch to /lib/pkp/classes/payment/PaymentManager.inc.php, I get:

Code: Select all
Call to a member function getJournal() on a non-object in /journalname/classes/payment/ojs/OJSPaymentManager.in.php on line 45, referer: /index.php/journalname/user


Before the patch, the error on the article submission page (which shows up as blank in the browser) is:

Code: Select all
Call to undefined method OJSPaymentManager::getManager() in /journalname/classes/author/form/submit/AuthorSubmitStep1Form.inc.php on line 57.


Hope that helps.

Graham
pixelandpen
 
Posts: 12
Joined: Thu Aug 29, 2013 6:10 am

Re: OJSPaymentManager::getManager() in 2.4.2

Postby asmecher » Fri Aug 30, 2013 12:28 pm

Hi Graham,

Let's reverse the patch and try dealing with this error message:
Code: Select all
Call to undefined method OJSPaymentManager::getManager() in /journalname/classes/author/form/submit/AuthorSubmitStep1Form.inc.php on line 57.
What do you see in line 57 of AuthorSubmitStep1Form.inc.php? It should read:
Code: Select all
$paymentManager = new OJSPaymentManager($this->request);
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJSPaymentManager::getManager() in 2.4.2

Postby pixelandpen » Fri Aug 30, 2013 12:38 pm

Line 57 used to read

Code: Select all
$paymentManager =& OJSPaymentManager::getManager();


I changed it to

Code: Select all
$paymentManager = new OJSPaymentManager($this->request);


as you suggested, but it still creates a blank page when trying to create a submission, and the error log says:

Code: Select all
Call to a member function getJournal() on a non-object in /journalname/classes/payment/ojs/OJSPaymentManager.inc.php
pixelandpen
 
Posts: 12
Joined: Thu Aug 29, 2013 6:10 am

Re: OJSPaymentManager::getManager() in 2.4.2

Postby asmecher » Fri Aug 30, 2013 1:08 pm

Hi Graham,

That's consistent with the request object not being set. Track back further to the constructor of AuthorSubmitStep1Form.inc.php:
Code: Select all
function AuthorSubmitStep1Form(&$article, &$journal, $request) {
    parent::AuthorSubmitForm($article, 1, $journal, $request);
    ...
This takes the request object from the caller and passes it into the superclass (AuthorSubmitForm.inc.php), which in turn reads...
Code: Select all
function AuthorSubmitForm(&$article, $step, &$journal, &$request) {
    ...
    $this->request =& $request;
}
Does your code agree?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJSPaymentManager::getManager() in 2.4.2

Postby pixelandpen » Fri Aug 30, 2013 7:35 pm

The $request parameters were missing in the functions you specified. The first page of the submission process now loads correctly. However, when I try to submit something, it shows a blank page at the /journalname/author/saveSubmit/# URL. The error log says:

Code: Select all
Call to undefined method Submission::addAuthor() in /journalname/classes/article/Article.inc.php


Any further direction is greatly appreciated.

Cheers,

Graham
pixelandpen
 
Posts: 12
Joined: Thu Aug 29, 2013 6:10 am

Re: OJSPaymentManager::getManager() in 2.4.2

Postby pixelandpen » Tue Sep 03, 2013 8:16 am

FYI, this morning I applied all relevant patches as listed at http://pkp.sfu.ca/wiki/index.php?title= ... ed_Patches (i.e. skipped those for PSQL, PayPal, and upgrades for 2.4.0). I still have the same issue with the blank page after submitting a new article.

Graham
pixelandpen
 
Posts: 12
Joined: Thu Aug 29, 2013 6:10 am

Re: OJSPaymentManager::getManager() in 2.4.2

Postby asmecher » Tue Sep 03, 2013 8:40 am

Hi Graham,

I'm concerned that some of your code seems to have not been brought up to the level of OJS 2.4.2. It sounds like there's still a mix of code present from 2.3.8. I'd suggest double-checking that you've reconciled any ".rej" files left around your installation, and failing that, using "diff" to compare your installation to the stock OJS 2.4.2 package to see what differences are present.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJSPaymentManager::getManager() in 2.4.2

Postby pixelandpen » Tue Sep 03, 2013 8:47 am

Alec, should I reapply the 2.3.8 to 2.4.2 patch again, or just check the existing .rej files for any missing changes?

Graham
pixelandpen
 
Posts: 12
Joined: Thu Aug 29, 2013 6:10 am

Re: OJSPaymentManager::getManager() in 2.4.2

Postby asmecher » Tue Sep 03, 2013 10:27 am

Hi Graham,

You'll need to reconcile *all* .rej files that are lying around before the system will behave predictably. If you find that some of the changes we've discussed above were included in those, that'll be a good validation. If not, I'd still be concerned that something went wrong -- diff is a good way to verify.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJSPaymentManager::getManager() in 2.4.2

Postby pixelandpen » Wed Sep 04, 2013 8:32 am

I ended up running the patch file using "patch -p1 -f < PATCH_FILE" (notice the -f parameter), then dealing with any .rej files, and now the site is operational at 2.4.2. I hope this helps anyone else experiencing similar difficulties.

Thanks to Alec who patiently walked me through the debugging.

Cheers,

Graham
pixelandpen
 
Posts: 12
Joined: Thu Aug 29, 2013 6:10 am


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 4 guests

cron