? Pending

User tests: Successful: 0 Unsuccessful: 0

avatar Denitz
Denitz
17 Nov 2022

Summary of Changes

Tag view incorrectly creates $tag->text as NULL on empty core_body, hence the content plugins can raise deprecation warning in PHP 8.1

Old code:

!empty($itemElement->core_body) ? $itemElement->text = $itemElement->core_body : $itemElement->text = null;

Even core loadmodule plugin doesn't check if $article->text is not null:

if (strpos($article->text, '{loadposition') === false && strpos($article->text, '{loadmodule') === false) {

We need to use empty string to satisfy most of plugins which are using strpos() and don't check if $article->text exists and is actually a string.

Also: updated onContentPrepare trigger for each tagged item to a new Event, like in com_content article view.

Testing Instructions

PHP 8.1, error reporting dev

View a tag page with items, tagged items should have empty description

Actual result BEFORE applying this Pull Request

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in \plugins\content\loadmodule\loadmodule.php on line 53

Expected result AFTER applying this Pull Request

No warnings.

avatar Denitz Denitz - open - 17 Nov 2022
avatar Denitz Denitz - change - 17 Nov 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Nov 2022
Category com_tags Front End
avatar Denitz Denitz - change - 17 Nov 2022
Labels Added: ?
avatar Quy
Quy - comment - 24 Jan 2023

Fixed per #39640. Closing as the other change should be in a separate PR. Thanks.

avatar Quy Quy - close - 24 Jan 2023
avatar Quy Quy - change - 24 Jan 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-01-24 05:30:11
Closed_By Quy

Add a Comment

Login with GitHub to post a comment