NPM Resource Changed PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
1 Dec 2023

Summary of Changes

There are situations where for some reason the AJAX call for suggestions in Smart Search fails. When typing very fast into the search box and hitting enter, the browser has fired an AJAX call for every character typed and the server might not have responded. When hitting enter, the form is send and all AJAX requests are aborted. This lets the JS code return and run into the failure condition, resulting in a flash of error messages being displayed. While it is nice to know that something failed for a developer, this should not be displayed to the general enduser. The JS code right now can spam the screen with system messages for these failed calls, especially since a call is triggered for each character entered into the search box. This PR removes this error handling.

Testing Instructions

  1. Go to /components/com_finder/src/Controller/SuggestionsController.php and insert
    echo '1';
    in line 43 to create a broken output from the controller.
  2. Type into the search box of mod_finder and see loads of system error messages displayed.
  3. Apply the patch. (remember to run npm)
  4. Type into the search box and don't see the previous messages.
  5. Remove the code from line 43 and type again. See the suggestions appearing again.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar Hackwar Hackwar - open - 1 Dec 2023
avatar Hackwar Hackwar - change - 1 Dec 2023
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Dec 2023
Category JavaScript Repository NPM Change
avatar Hackwar Hackwar - change - 1 Dec 2023
Labels Added: NPM Resource Changed PR-5.0-dev
avatar Fedik
Fedik - comment - 1 Dec 2023

I suggest to add:

// eslint-disable-next-line no-console
console.error(error);

Or it will be impossible to debug in case of error.

avatar Hackwar Hackwar - change - 6 Dec 2023
The description was changed
avatar Hackwar Hackwar - edited - 6 Dec 2023
avatar Hackwar
Hackwar - comment - 6 Dec 2023

Done and I found out the reason for the error. I described it in the description at the top.

avatar paternax
paternax - comment - 6 Dec 2023

I have tested the patch in two 4.4.1 Joomla Websites where this message had shown very often and was irritating the visitor of the sites. In both cases the message dissappeared after transferring the files. Thank you Hackwar

avatar Hackwar Hackwar - change - 10 Dec 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-12-10 16:22:54
Closed_By Hackwar
avatar Hackwar
Hackwar - comment - 10 Dec 2023

I've re-done the PR for 4.4, since this affects all versions, both 4.4 and 5.x, and this way it can be upmerged from 4.4 to 5.0 to 5.1. Closing this one. @paternax if you could retest that new PR, I would be very gratefull.

avatar Hackwar Hackwar - close - 10 Dec 2023

Add a Comment

Login with GitHub to post a comment