User tests: Successful: Unsuccessful:
Pull Request for Issue #35941 .
When a third-party component does not use the help buttons on the categories page (or in other words do not have /components/$component/forms/$name.xml file), there are a bunch of PHP warning messages caused by uninitialized variables.
$ref_key & $url variables are initialized only when the file is available.
Added checks for empty variables so that they do not generate PHP warning messages
Create a component and add categories support. Go to the categories dashboard page of the component.
There were following PHP errors
Warning: Undefined variable $ref_key in /root../administrator/components/com_categories/src/View/Categories/HtmlView.php on line 302
Warning: Undefined variable $url in /root../administrator/components/com_categories/src/View/Categories/HtmlView.php on line 318
Warning: Undefined variable $url in /root../administrator/components/com_categories/src/View/Categories/HtmlView.php on line 328
No errors
None
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_categories |
Labels |
Added:
?
|
I just upgraded a Joomla! 3 test site to 4, and saw these exact warnings when visited Components->Web Links->Categories.
@boddunan Do you have a component which we can use to test this PR ? From what I see, these variables are already initialized at https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_categories/src/View/Categories/HtmlView.php#L290-L291 , so not sure how the warnings you mentioned could happen.
The code that you mentioned was added by the below commit (after opening this PR).
28c346d#diff-4262b0c8c876600659b8ed9230945998d173ccda31afb27fdc1fd45412d0189f
However, the code is still not fixed in 4.1 dev branch.
Closing as this is fixed in 4.0.5 with #35662. Please test with the nightly builds: https://developer.joomla.org/nightly-builds.html
Changes in 4.0 will be ported to 4.1.
Thank you for your contribution.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-11-11 16:43:23 |
Closed_By | ⇒ | Quy | |
Labels |
Added:
Information Required
|
@boddunan Do you have a component which we can use to test this PR ? From what I see, these variables are already initialized at https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_categories/src/View/Categories/HtmlView.php#L290-L291 , so not sure how the warnings you mentioned could happen.