OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Use of undefined constant HANDLER_CLASS

Open Harvester Systems support questions and answers, bug reports, and development issues.

Moderators: jmacgreg, michael, John

Forum rules
Developer Resources:

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome.

Use of undefined constant HANDLER_CLASS

Postby alexukua » Fri Jan 07, 2011 3:18 pm

I have problem, if open page

http://oai.org.ua/index.php/user/user

Code: Select all
NOTICE: Use of undefined constant HANDLER_CLASS - assumed 'HANDLER_CLASS' (/usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php:164)
harvester2 has produced an error Message: WARNING: array_map() [function.array-map]: Argument #2 should be an array In file: /usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php At line: 164 Stacktrace: File: (unknown) line (unknown) Function: PKPApplication->errorHandler(2, "array_map() [<a href='function.array-map'>function.array-map</a>]: Argument #2 should be an array", "/usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php", 164, Array(5)) File: /usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php line 164 Function: array_map("strtolower", Null) File: /usr/share/harvester/lib/pkp/classes/core/Dispatcher.inc.php line 128 Function: PKPPageRouter->route(Object(Request)) File: /usr/share/harvester/lib/pkp/classes/core/PKPApplication.inc.php line 176 Function: Dispatcher->dispatch(Object(Request)) File: /usr/share/harvester/index.php line 65 Function: PKPApplication->execute() Server info: OS: Linux PHP Version: 5.2.6-1+lenny2 Apache Version: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny2 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0 DB Driver: mysql DB server version: 5.0.51a-24
harvester2 has produced an error Message: WARNING: in_array() [function.in-array]: Wrong datatype for second argument In file: /usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php At line: 165 Stacktrace: File: (unknown) line (unknown) Function: PKPApplication->errorHandler(2, "in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument", "/usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php", 165, Array(6)) File: /usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php line 165 Function: in_array("user", Null) File: /usr/share/harvester/lib/pkp/classes/core/Dispatcher.inc.php line 128 Function: PKPPageRouter->route(Object(Request)) File: /usr/share/harvester/lib/pkp/classes/core/PKPApplication.inc.php line 176 Function: Dispatcher->dispatch(Object(Request)) File: /usr/share/harvester/index.php line 65 Function: PKPApplication->execute() Server info: OS: Linux PHP Version: 5.2.6-1+lenny2 Apache Version: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny2 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0 DB Driver: mysql DB server version: 5.0.51a-24
harvester2 has produced an error Message: WARNING: Cannot modify header information - headers already sent by (output started at /usr/share/harvester/lib/pkp/classes/core/PKPApplication.inc.php:364) In file: /usr/share/harvester/lib/pkp/classes/core/Dispatcher.inc.php At line: 240 Stacktrace: File: (unknown) line (unknown) Function: PKPApplication->errorHandler(2, "Cannot modify header information - headers already sent by (output started at /usr/share/harvester/lib/pkp/classes/core/PKPApplication.inc.php:364)", "/usr/share/harvester/lib/pkp/classes/core/Dispatcher.inc.php", 240, Array(0)) File: /usr/share/harvester/lib/pkp/classes/core/Dispatcher.inc.php line 240 Function: header("HTTP/1.0 404 Not Found") File: /usr/share/harvester/lib/pkp/classes/core/PKPPageRouter.inc.php line 167 Function: Dispatcher->handle404() File: /usr/share/harvester/lib/pkp/classes/core/Dispatcher.inc.php line 128 Function: PKPPageRouter->route(Object(Request)) File: /usr/share/harvester/lib/pkp/classes/core/PKPApplication.inc.php line 176 Function: Dispatcher->dispatch(Object(Request)) File: /usr/share/harvester/index.php line 65 Function: PKPApplication->execute() Server info: OS: Linux PHP Version: 5.2.6-1+lenny2 Apache Version: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny2 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0 DB Driver: mysql DB server version: 5.0.51a-24


And use can not register on system.


Please help me.
alexukua
 
Posts: 32
Joined: Thu Oct 16, 2008 3:27 am

Re: Use of undefined constant HANDLER_CLASS

Postby asmecher » Fri Jan 07, 2011 5:23 pm

Hi alexukua,

Where are you following that link from? It's an incorrect URL.

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

Re: Use of undefined constant HANDLER_CLASS

Postby alexukua » Mon Jan 10, 2011 1:28 am

Yes it link correct
+ not working registration

http://oai.org.ua/index.php/login?sourc ... 2Fregister
alexukua
 
Posts: 32
Joined: Thu Oct 16, 2008 3:27 am

Re: Use of undefined constant HANDLER_CLASS

Postby asmecher » Mon Jan 10, 2011 11:11 am

Hi alexukua,

I think the registration process must have been modified on your server; I'm not sure how the current behavior is possible with an unmodified copy of OHS 2.3.1.

Where is the link to .../user/user appearing in the OHS user interface?

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

Re: Use of undefined constant HANDLER_CLASS

Postby btbell » Fri Nov 30, 2012 2:56 pm

Alec,

We are running into the register/redirect issue here at Pitt. We're using OHS 2.3.1 and we've been doing some exploring on this. We are wondering why the register portion of the code looks to be requiring a authenticated user. If we comment out the following from pages/user/UserHandler.inc.php:

Code: Select all
 /**
         * Validate that user is logged in.
         * Redirects to login form if not logged in.
         * @param $loginCheck boolean check if user is logged in
         */
        function validate($loginCheck = true) {
                parent::validate();
                if ($loginCheck && !Validation::isLoggedIn()) {
                        Validation::redirectLogin();
                }
        }


and then point the browser to the registration page, it then works as expected, but it may cause issues elsewhere. If you have an easy way to address the registration requirement for a valid login, please advise. Else we will continue to investigate to find a patch/fix for this.

Let us know. Thanks!

Brian Bell
University of Pittsburgh-ULS
btbell
 
Posts: 16
Joined: Tue Nov 06, 2012 1:19 pm

Re: Use of undefined constant HANDLER_CLASS

Postby asmecher » Fri Nov 30, 2012 3:50 pm

Hi Brian,

Oops, you're absolutely right! See http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8048 for a patch; you need only remove the parent::validate line in pages/user/RegistrationHandler.inc.php; removing the entire UserHandler::validate function is probably not safe.

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

Re: Use of undefined constant HANDLER_CLASS

Postby btbell » Tue Dec 04, 2012 1:51 pm

Alec,

Thanks for the quick turnaround. I commented out the parent::validate() method, and this resolved the redirect when clicking on the Registration link. However, now when you try to create a new archive, when you click the Save button after filling out the Add Archive form, you get the error message "Errors occurred processing this form:
btbell
 
Posts: 16
Joined: Tue Nov 06, 2012 1:19 pm

Re: Use of undefined constant HANDLER_CLASS

Postby btbell » Tue Dec 04, 2012 1:56 pm

Alec,

Thanks for the quick turnaround. I commented out the parent::validate() method, and this resolved the redirect when clicking on the Registration link. However, now when you login in and try to create a new archive, when you click the Save button after filling out the Add Archive form, you get the error message "Errors occurred processing this form: The characters you entered did not match the characters in the image. Please check the characters and try again." Not sure why it thinks there's a Captcha image on this form but there isn't, we're just creating a new archive with a logged in user session. Do you have any ideas?

Thanks again!

-Brian

Brian Bell
University of Pittsburgh-ULS
btbell@pitt.edu
btbell
 
Posts: 16
Joined: Tue Nov 06, 2012 1:19 pm

Re: Use of undefined constant HANDLER_CLASS

Postby asmecher » Tue Dec 04, 2012 2:24 pm

Hi Brian,

Do you have a valid font configured in the font_location setting in config.inc.php?
Alternately, you could consider disabling the captcha_on_submit setting.

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

Re: Use of undefined constant HANDLER_CLASS

Postby btbell » Tue Dec 18, 2012 1:27 pm

NOTE: this only works in OHS 2.3.1. It breaks in 2.3.2. I will continue to chase this and update the progress.

Ok, here's a fix to the secondary error
"Errors occurred processing this form: The characters you entered did not match the characters in the image. Please check the characters and try again."


In /classes/admin/form/ArchiveForm.inc.php, the validation code for isSiteAdmin is changed to isLoggedIn (should be ~ line 58),

Code: Select all
if ($this->captchaEnabled && !Validation::isLoggedIn()) {


-Brian
ULS - University of Pittsburgh
btbell
 
Posts: 16
Joined: Tue Nov 06, 2012 1:19 pm


Return to Open Harvester Systems Support and Development

Who is online

Users browsing this forum: No registered users and 0 guests