? ? Pending

User tests: Successful: Unsuccessful:

avatar YatharthVyas
YatharthVyas
11 May 2021

Pull Request for Issue #33490

Summary of Changes


Reason behind this issue

I debugged the array of id(s) which were queried for deletion and their query result:

Array of ids to be deleted: [5,4,10,14,13,12,11,15,7,6,9,8,3,2]
Status:
5 - done
4 - done
10 - failed
id Name
5 author/yatharthvyas ✔️ Successfully deleted
4 author ✔️ Successfully deleted but since it was a root level map, it also deleted all it's children along with it, so now id=10 was no longer present in the table
10 author/joomla Failed because it was already deleted in the query of it's parent (id: 4).
This conditional block for key not in table returned false and ended the execution here skipping all remaining queries in the array.

Changes Made:

The condition that checks if the key is in the table is now shifted outside the loop so when an element is deleted, that doesn't generate any error and return prematurely. Incase any key is not present, then it would be checked before deletion and the execution would stop then and there


Testing Instructions

Before testing, Please take a backup of #_finder_taxonomy table to avoid the loss of any data

  1. Visit Backend
  2. Components -> Smart Search -> Content Map
  3. Ensure that you have sufficient data in this table with multiple parent-level and child-level maps (Installting Blog Sample Data will also work)
  4. Click on the select all checkbox and proceed to delete them.

Before the PR, only the first parent and its children would get deleted and then the function would return false skipping the remaining elements.
After the PR, you should see the Empty State, ie. All items deleted successfully.


Actual result BEFORE applying this Pull Request

Please refer to the video in #33490


Expected result AFTER applying this Pull Request

content_map_fixed


Documentation Changes Required

None

avatar YatharthVyas YatharthVyas - open - 11 May 2021
avatar YatharthVyas YatharthVyas - change - 11 May 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 May 2021
Category Administration com_finder
avatar brianteeman brianteeman - test_item - 11 May 2021 - Tested successfully
avatar brianteeman
brianteeman - comment - 11 May 2021

I have tested this item successfully on 9b14e15


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

avatar YatharthVyas YatharthVyas - change - 11 May 2021
Labels Added: ?
avatar PhilETaylor PhilETaylor - test_item - 11 May 2021 - Tested successfully
avatar PhilETaylor
PhilETaylor - comment - 11 May 2021

I have tested this item successfully on 04752bc


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

avatar richard67 richard67 - alter_testresult - 11 May 2021 - brianteeman: Tested successfully
avatar richard67 richard67 - change - 11 May 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 11 May 2021

RTC


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

avatar Quy Quy - close - 11 May 2021
avatar Quy Quy - merge - 11 May 2021
avatar Quy Quy - change - 11 May 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-05-11 12:54:36
Closed_By Quy
Labels Added: ?
avatar Quy
Quy - comment - 11 May 2021

Thank you!

avatar YatharthVyas
YatharthVyas - comment - 11 May 2021

Thanks everyone

Add a Comment

Login with GitHub to post a comment