Skip to content

Fix deprecation warning in com_tags#37568

Merged
laoneo merged 4 commits intojoomla:4.1-devfrom
chmst:tags-deprecatd-warning
Jun 3, 2022
Merged

Fix deprecation warning in com_tags#37568
laoneo merged 4 commits intojoomla:4.1-devfrom
chmst:tags-deprecatd-warning

Conversation

@chmst
Copy link
Copy Markdown
Contributor

@chmst chmst commented Apr 16, 2022

Pull Request for Issue #37567 .

Summary of Changes

The method getItem() returns an array but this is initialsed with "false".

Remark: It looks wrong that getItem() returns an array, but this is not in scope of this fix.

Testing Instructions

See #37567

Actual result BEFORE applying this Pull Request

Deprecation warning

Expected result AFTER applying this Pull Request

No deprecation warning

Documentation Changes Required

no

@chmst chmst added the PHP 8.x PHP 8.x deprecated issues label Apr 16, 2022
@richard67
Copy link
Copy Markdown
Member

@chmst The issue which you have closed for this PR was not an issue but a PR, too. Maybe the issue tracker hasn’t shown that?

@chmst
Copy link
Copy Markdown
Contributor Author

chmst commented Apr 16, 2022

Not used to github on my IDE ;)

@chmst chmst closed this Apr 16, 2022
@frostmakk
Copy link
Copy Markdown
Contributor

If this is a better solution than my PR just close mine, no problem.

@chmst
Copy link
Copy Markdown
Contributor Author

chmst commented Apr 16, 2022

Sorry ;) By chance I ad exactly the same code open when your PR appeared. I think your solution is better. Both resolve the deprecated warning.

@chmst chmst reopened this Apr 24, 2022
@laoneo
Copy link
Copy Markdown
Member

laoneo commented Apr 24, 2022

While this here is a correct fix, I'm wondering why it returns here

$this->item[] = ArrayHelper::toObject($properties, CMSObject::class);
an array with only one element that is again an array of properties. Should it not return just the array with properties?

@chmst
Copy link
Copy Markdown
Contributor Author

chmst commented Apr 24, 2022

I mentioned already that this method looks strange. A method getItem() should return an Item, not an array and have one integer as argument, not an array. This fix resolves only the php 8.1 warning,

@laoneo laoneo added the Maintainers Checked Used if the PR is conceptional useful label May 19, 2022
@joomdonation
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on a105ac7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37568.

1 similar comment
@alikon
Copy link
Copy Markdown
Contributor

alikon commented May 27, 2022

I have tested this item ✅ successfully on a105ac7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37568.

@alikon
Copy link
Copy Markdown
Contributor

alikon commented May 27, 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37568.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 27, 2022
@laoneo laoneo merged commit f503f16 into joomla:4.1-dev Jun 3, 2022
@laoneo
Copy link
Copy Markdown
Member

laoneo commented Jun 3, 2022

Thanks!

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 3, 2022
@laoneo laoneo added this to the Joomla 4.1.5 milestone Jun 3, 2022
@chmst chmst deleted the tags-deprecatd-warning branch December 13, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainers Checked Used if the PR is conceptional useful PHP 8.x PHP 8.x deprecated issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants