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

Improve Finder ajax error handling #39973

Merged
merged 4 commits into from
Mar 6, 2023
Merged

Conversation

Fedik
Copy link
Member

@Fedik Fedik commented Mar 1, 2023

Pull Request for Issue #39717 and #39965 .

Summary of Changes

Catch broken json and show an error message.
For Finder indexer, and for Finder autocomplete.

Testing Instructions

Apply patch, run npm install.

  1. Repeat test from [5.0] Smart Search: Improving error handling of Indexing #39965
    Go to a finder plugin, for example /plugins/finder/content/src/Extension/Content.php and trigger any output in the index() method. For example you can add var_dump($item->title).
    In the Smart Search component in the backend click on "Index".

  2. And similar for Autocomplete.
    Add var_dump(['error']) somewhere here

    public function suggest()
    {
    $app = $this->app;
    $app->mimeType = 'application/json';

    Make sure autocomplete is enabled, then go to site search page, and try to search something.

Actual result BEFORE applying this Pull Request

The ajax stops without any visible signs of life.

Expected result AFTER applying this Pull Request

You should get an error message.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

@Fedik Fedik requested a review from chmst as a code owner March 1, 2023 15:05
@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.2-dev labels Mar 1, 2023
@chmst
Copy link
Contributor

chmst commented Mar 3, 2023

I am confused .. @Fedik this is for 4.2 while @Hackwar has a PR for 4.3.

I have tested this PR on a 4.2 multilingual with blog sample data. But the output freezes without error message.
Need to find out why the npm ci did not do the job on the dev branch.

Repeated the test with the prebuild package and got a message

grafik

@chmst
Copy link
Contributor

chmst commented Mar 3, 2023

I have tested this item ✅ successfully on 5d37ee4


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

1 similar comment
@Quy
Copy link
Contributor

Quy commented Mar 3, 2023

I have tested this item ✅ successfully on 5d37ee4


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

@Quy
Copy link
Contributor

Quy commented Mar 3, 2023

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 3, 2023
@roland-d roland-d merged commit 3987fa3 into joomla:4.2-dev Mar 6, 2023
@roland-d
Copy link
Contributor

roland-d commented Mar 6, 2023

Thank you

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 6, 2023
@roland-d roland-d added this to the Joomla! 4.2.9 milestone Mar 6, 2023
@Fedik Fedik deleted the indexer-ajax-error branch March 7, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPM Resource Changed This Pull Request can't be tested by Patchtester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants