diff --git a/migrations/52-53/new-deprecations.md b/migrations/52-53/new-deprecations.md index b19a36dd..240fd6fc 100644 --- a/migrations/52-53/new-deprecations.md +++ b/migrations/52-53/new-deprecations.md @@ -23,7 +23,8 @@ $model = $this->getModel(); $this->items = $model->getItems(); ``` #### Explanation -Joomla and most extensions have extensively been using `Joomla\CMS\MVC\View\AbstractView::get()` in all views. From 5.3 onwards, this method is deprecated and is going to be removed in Joomla 7.0. +Joomla and most extensions have extensively been using `Joomla\CMS\MVC\View\AbstractView::get()` in all views. From 5.3 onwards, +this method is deprecated and is going to be removed in Joomla 7.0. This code in the past was used to retrieve data from the model. It was included in the `HtmlView.php` and often looked like this: ```php @@ -35,9 +36,12 @@ public function display($tpl = null) parent::display($tpl); } ``` -This code in the view called the method `get` on the model and returned the result. If the model didn't have such a method, it returned the classes attribute named by the first argument. +This code in the view called the method `get` on the model and returned the result. If the model didn't have such a method, +it returned the classes attribute named by the first argument. + +The downside of this is an indirection which no IDE and static code analyser can understand and which hides errors. The better +solution is to call the model directly, making it easy for an IDE to understand the code. The new code should look like this: -The downside of this is an indirection which no IDE and static code analyser can understand and which hides errors. The better solution is to call the model directly, making it easy for an IDE to understand the code. The new code should look like this: ```php public function display($tpl = null) { @@ -49,7 +53,10 @@ public function display($tpl = null) parent::display($tpl); } ``` -The first line is a docblock comment, which provides a hint for the IDE for the actual model that is used. The second line will retrieve the model set in the view. If you have more than one model in a view, you can provide it with a parameter to select the right model. The last two lines retrieve the actual data from the model. With the first two lines, IDEs can hint at the available methods in the model and now the returned values from those methods, making it possible to find issues further down the line. +The first line is a docblock comment, which provides a hint for the IDE for the actual model that is used. +The second line will retrieve the model set in the view. If you have more than one model in a view, you can provide it with a parameter to select the right model. +The last two lines retrieve the actual data from the model. With the first two lines, IDEs can hint at the available methods in the model +and now the returned values from those methods, making it possible to find issues further down the line. ## Deprecate `HTMLHelper::_('script')`, `HTMLHelper::_('stylesheet')` @@ -61,7 +68,20 @@ PR: https://github.com/joomla/joomla-cms/pull/43396 Deprecate the namespace property of the ComponentRecord class. The property were never initialised. PR: https://github.com/joomla/joomla-cms/pull/44754 + +## Plugins deprecations + +### CMSPlugin: Deprecate use of DispatcherAware and LanguageAware + +Plugin should use DispatcherAware on its own, when it needs to dispatch an event, like for example content/finder. +And language cannot be set on plugin while plugin booting, because it is not available until initialisation of the application is completed. + +PR: https://github.com/joomla/joomla-cms/pull/43430 + ## Dependency Deprecations ### TYPO3/phar-stream-wrapper -PHP 7 had a security issue with .phar packages. To circumvent the issue, the TYPO3 project created this wrapper. In PHP 8.0 this has been fixed in PHP and the whole wrapper is not needed anymore. This package will be removed in 6.0. + +PHP 7 had a security issue with .phar packages. To circumvent the issue, the TYPO3 project created this wrapper. +In PHP 8.0 this has been fixed in PHP and the whole wrapper is not needed anymore. This package will be removed in 6.0. +