OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Missing argument in call to registrationDisabled()

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.

Missing argument in call to registrationDisabled()

Postby springday » Sun Oct 21, 2012 5:11 am

Dear OJS team,

scanning through my warnings log, I found the following:

Message: WARNING: Missing argument 1 for RegistrationHandler::registrationDisabled(), called in /html/ojs/pages/user/RegistrationHandler.inc.php on line 179 and defined
In file: /html/ojs/pages/user/RegistrationHandler.inc.php
At line: 117
Stacktrace:
File: /html/ojs/pages/user/RegistrationHandler.inc.php line 117
Function: PKPApplication->errorHandler(2, "Missing argument 1 for RegistrationHandler::registrationDisabled(), called in /html/ojs/pages/user/RegistrationHandler.inc.php on line 179 and defined", "/html/ojs/pages/user/RegistrationHandler.inc.php", 117, Array(0))
File: /html/ojs/pages/user/RegistrationHandler.inc.php line 179
Function: RegistrationHandler->registrationDisabled()
File: /html/ojs/pages/user/RegistrationHandler.inc.php line 31
Function: RegistrationHandler->validate(Object(Request))
File: (unknown) line (unknown)
Function: RegistrationHandler->register(Array(0), Object(Request))
File: /html/ojs/lib/pkp/classes/core/PKPRouter.inc.php line 370
Function: call_user_func(Array(2), Array(0), Object(Request))
File: /html/ojs/lib/pkp/classes/core/PKPPageRouter.inc.php line 266
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(0), False)
File: /html/ojs/lib/pkp/classes/core/Dispatcher.inc.php line 133
Function: PKPPageRouter->route(Object(Request))
File: /html/ojs/lib/pkp/classes/core/PKPApplication.inc.php line 189
Function: Dispatcher->dispatch(Object(Request))
File: /html/ojs/index.php line 67
Function: PKPApplication->execute()
Server info:
OS: Linux
PHP Version: 5.2.13
Apache Version: N/A
DB Driver: mysql
DB server version: 5.5.17


When looking at the code I wonder what the $args are supposed to be used or passed for, as they are not used in this function. Probably the code here could be cleaned up?

Greetings,
Kai Weber
springday
 
Posts: 111
Joined: Wed Jul 25, 2012 2:56 pm
Location: Munich, Germany

Re: Missing argument in call to registrationDisabled()

Postby JasonNugent » Sun Oct 21, 2012 4:04 pm

Hi Kai,

all handler functions that can be called via mappings in the index.php file in each page directory are supposed to accept two arguments - an array of arguments that may end up being passed to the handler, and a request object. That first 'args' parameter is an array that ends up containing stuff like pages/handlerFunc/1/2. Some times it's empty. What appears to be happening in your example is the validate() method not passing anything in. It should pss an empty array as the first argument and then also pass the request object it receives. I'll fix it up.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 888
Joined: Tue Jan 10, 2006 6:20 am

Re: Missing argument in call to registrationDisabled()

Postby JasonNugent » Sun Oct 21, 2012 4:06 pm

Now that I look at the code a bit more I realize that there is no public way to call registrationDisabled at all. So it doesn't need the args array. But it does need the request object.
JasonNugent
Site Admin
 
Posts: 888
Joined: Tue Jan 10, 2006 6:20 am


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 3 guests