?
avatar javitineo
javitineo
21 Nov 2017

Steps to reproduce the issue

Hi, i had some code inside the authentication class in Joomla 3.7.3
When i upgrade to joomla 3.8.2 i'm trying to add this code in the same place but it doesnt run:
the code is:
include_once(dirname($_SERVER['DOCUMENT_ROOT']) . DIRECTORY_SEPARATOR .ROOT_PATH."/usuario/TUsuario.php");
$usuario= new TUsuario();
$usuario->.....etc

the error that appear are "cannot redeclare class", "Class 'Joomla\CMS\Authentication\TUsuario' not found in ...../libraries/src/Authentication/Authentication.php".
I suppose there is a new way of doing this kind of including, could anybody help me please?.
Thanks

Expected result

Do custom tasks inside the function authenticate()

Actual result

error of custom class not found

System information (as much as possible)

Joomla 3.8.2
Php 5.6
This way of doing the include runs in Joomla 3.7.3

Additional comments

avatar javitineo javitineo - open - 21 Nov 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Nov 2017
avatar javitineo
javitineo - comment - 21 Nov 2017
avatar javitineo javitineo - change - 21 Nov 2017
The description was changed
avatar javitineo javitineo - edited - 21 Nov 2017
avatar javitineo javitineo - change - 21 Nov 2017
The description was changed
avatar javitineo javitineo - edited - 21 Nov 2017
avatar javitineo javitineo - change - 21 Nov 2017
Title
How to include custom include inside a Joomla 3.8 library
How to include a reference to a custom class inside a Joomla 3.8 library
avatar javitineo javitineo - edited - 21 Nov 2017
avatar javitineo javitineo - change - 21 Nov 2017
The description was changed
avatar javitineo javitineo - edited - 21 Nov 2017
avatar mbabker mbabker - change - 21 Nov 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-11-21 15:59:31
Closed_By mbabker
avatar mbabker mbabker - close - 21 Nov 2017
avatar mbabker
mbabker - comment - 21 Nov 2017

What you're doing is in essence core hacking. I don't think anyone here is going to give information on how to successfully do that in an update safe way (because there isn't one).

Use the plugin system the way it was designed to add your custom logic, do not core hack the core authentication handler.

Closing, not a core issue.

Add a Comment

Login with GitHub to post a comment