? ? Pending

User tests: Successful: Unsuccessful:

avatar roland-d
roland-d
24 Feb 2021

Summary of Changes

When you add a hidden field to the search filters you will see an error message in the console and the searchtools like:

Uncaught TypeError: element.labels is null
    activeFilter http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:330
    checkFilter http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:222
    Searchtools http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:167
    Searchtools http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:166
    onBoot http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:542
    EventListener.handleEvent* http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:563
    <anonymous> http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:564
searchtools.js:330:13

This is caused by a hidden field in the filter_VIEW.xml file. This field has no label field and is not required according to the documentation at https://docs.joomla.org/Hidden_form_field_type

Testing Instructions

  1. Open the file administrator/components/com_content/forms/filter_articles.xml
  2. After the search field add this field
<field
	name="search_id"
	type="hidden"
	default="abc"
/>
  1. Login to your Joomla 4 site
  2. Open the browser console page
  3. Open the Articles List page
  4. See the error in the console page
  5. Apply the pull request
  6. Compile the JS with npm run build:js
  7. Refresh the Articles List
  8. Notice there are no more errors in the console

Actual result BEFORE applying this Pull Request

An error is shown in the console

Uncaught TypeError: element.labels is null
    activeFilter http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:330
    checkFilter http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:222
    Searchtools http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:167
    Searchtools http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:166
    onBoot http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:542
    EventListener.handleEvent* http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:563
    <anonymous> http://joomlacms.test/media/system/js/searchtools.js?7039b530192126304eb4d7e43f009e45:564
searchtools.js:330:13

Expected result AFTER applying this Pull Request

There are no errors in the console.

Documentation Changes Required

None

avatar roland-d roland-d - open - 24 Feb 2021
avatar roland-d roland-d - change - 24 Feb 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2021
Category JavaScript Repository NPM Change
avatar ceford ceford - test_item - 25 Feb 2021 - Tested successfully
avatar ceford
ceford - comment - 25 Feb 2021

I have tested this item successfully on 74f0d35

Works as described.


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

avatar Quy Quy - test_item - 25 Feb 2021 - Tested successfully
avatar Quy
Quy - comment - 25 Feb 2021

I have tested this item successfully on 74f0d35


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

avatar Quy Quy - change - 25 Feb 2021
Status Pending Ready to Commit
Labels Added: ?
avatar Quy
Quy - comment - 25 Feb 2021

RTC


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

avatar wilsonge wilsonge - change - 25 Feb 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-02-25 17:02:43
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 25 Feb 2021
avatar wilsonge wilsonge - merge - 25 Feb 2021
avatar wilsonge
wilsonge - comment - 25 Feb 2021

Thanks!

Add a Comment

Login with GitHub to post a comment