User tests: Successful: Unsuccessful:
Deprecated classes, assets and classnames can be moved to the compatibility plugin, but not single deprecated functions. In core we have a lot of deprecated functions which are widely used in the past in template overrides or other custom PHP code. Removing them would be a hard backwards compatibility break. This pr introduces a switch for deprecated functions, enabled in the compatibility plugin. This is a fallback for sites with old code or unmaintained extensions to give them an extra two years to update that code.
Add the following code to the file /components/com_content/src/Dispatcher/Dispatcher.php after line 36:
\Joomla\CMS\Factory::getConfig();
Load the site home page with the compatibility 7 plugin enabled and disabled.
It works with the plugin enabled and disabled.
It shows an error when the plugin is disabled and loads fine when enabled.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org: joomla/Manual#671
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries Front End Plugins |
| Labels |
Added:
PR-7.0-dev
|
||
| Category | Libraries Front End Plugins | ⇒ | Libraries Front End Plugins Unit Tests |
| Labels |
Added:
Unit/System Tests
|
||
From PHP manual:
Passing E_USER_ERROR as the error_level is now deprecated. Throw an Exception or call exit() instead.
Maybe throw BadMethodCallException could be a better choice here.
I had exceptions first, but then you copy basically the same text as in trigger_error. Till we have a decision if this is an acceptable way to transition from widely used deprecated code I leave it as it is. But I was not aware that the constant was deprecated, definitely worth then to switch to exception.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
| Status | Pending | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-06-17 12:15:50 |
| Closed_By | ⇒ | HLeithner |
thanks
From PHP manual:
Passing [E_USER_ERROR](https://www.php.net/manual/en/errorfunc.constants.php#constant.e-user-error) as the error_level is now deprecated. Throw an [Exception](https://www.php.net/manual/en/class.exception.php) or call [exit()](https://www.php.net/manual/en/function.exit.php) instead.Maybe throw
BadMethodCallExceptioncould be a better choice here.