Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define correct type for field helper doc #42635

Merged
merged 3 commits into from Jan 10, 2024

Conversation

laoneo
Copy link
Member

@laoneo laoneo commented Jan 10, 2024

The $item parameter FieldsHelper::getFields has to be an object or array and not null.

@sandewt
Copy link
Contributor

sandewt commented Jan 10, 2024

The $item parameter FieldsHelper::getFields has to be an object or array and not null.

I don't understand this, because in line 108 $item gets the value null? You probably mean something else.

In line 128 I can see that the variable $item can be an array.

How can I best test this PR?

@laoneo
Copy link
Member Author

laoneo commented Jan 10, 2024

Use a debugger and check the types of $item while working with custom fields. But as you can see in the code, it can be an object, array or null. The doc comment is wrong as it can, but not must, be null.

If you want to test something as this one here is just cosmetic, better to look at #42473.

@sandewt
Copy link
Contributor

sandewt commented Jan 10, 2024

I have tested this item ✅ successfully on 37df313

cosmetically tested by just looking at the code


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

@chmst
Copy link
Contributor

chmst commented Jan 10, 2024

I have tested this item ✅ successfully on 37df313

Working on differnt applications with custom fields. No problem with this PR.


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

@Quy
Copy link
Contributor

Quy commented Jan 10, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 10, 2024
@MacJoom MacJoom added this to the Joomla 4.4.3 milestone Jan 10, 2024
@MacJoom MacJoom enabled auto-merge (squash) January 10, 2024 17:12
@MacJoom MacJoom self-assigned this Jan 10, 2024
@MacJoom MacJoom merged commit b73168f into joomla:4.4-dev Jan 10, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 10, 2024
@laoneo laoneo deleted the fields/comment branch January 17, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants