Whene you move a categorie to a parent category this the batch process the first time the categorie disappears, after that moving a category will result in an error: Batch process failed with following error: Another category with the same parent category has the same alias. Moving a child element to another parent or to the root gives the same error.
This error occurse even when the selected parent has no other children and there are no duplicate aliases. Even in the trash.
Create 2 of more categories.
Select 1 of more categories.
Click 'Actions' and choose batch.
Select a parent category at 'Copy or Move to Category'.
Leave all other settings and click 'Process'
Selected categories are now children of the selected parent category
The first time you do this the categorie(s) will disappear.
The secont time you will get the error 'Batch process failed with following error: Another category with the same parent category has the same alias.'
No categories are moved.
Joomla 4.2.7 RC1, PHP Version 8.0.27
Other tester confirmed this problem.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
Labels |
Added:
Release Blocker
|
I could reproduce the issue with 4.2.6, so it's not a regression from 4.2.7-rc1.
I created 3 categories. First I have moved the 2nd one to the 1st one. The 2nd one disappeared in the list view. Then I have tried to move the 3rd one to the 2nd one and got the error message about duplicate alias.
In database, the 2nd category has lost all its values and so has lft and rgt and level = 0, path = 'root', title and alias are empty and description and params = NULL and so on.
Of course when the same happens to the 3rd category when trying to move it, it will have the same empty alias as the 2nd has, therefore the error message.
As you can see in the above screenshot, the category also has a new asset id 94 instead of the 92 it should still have.
I'm sure we have an old open issue for this
@richard67 Could you try to revert the change from this PR #39158 to see if it solves the issue? Have to read the code more carefully but I think the code on this line https://github.com/joomla/joomla-cms/blob/4.2-dev/administrator/components/com_categories/src/Model/CategoryModel.php#L1174 reset the category data and it causes data lost as you found.
I'm sure we have an old open issue for this
@brianteeman Maybe this? #19381
@joomdonation Can't check that right now because have to do something else which can not wait. Will check later.
@joomdonation I took the time and checked. It works when I revert the change from PR #39158 . But this would bring back issue #39137 , right?
@richard67 Yes, it would bring back the issue. But we should be able to fix it without reverting the original PR.
Instead of using existing $this->table object to load data for validation (which causes data lost for category being processed), we can use a new table object. I will try to read code to understand the logic more and if it is all OK, I will make PR.
@joomdonation George @wilsonge had some concert after that PR had been merged by me, see his comment there: #39158 (comment) . But he never replied my question if we should revert that PR. Maybe you should check his comment before you make your PR.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-01-29 15:57:28 |
Closed_By | ⇒ | joomdonation |
@richard67 Yes, I read the comment. It would be perfect if we make it works like that. However, at the moment, there is no easy way. We will need to discuss more about how should we handle it :
Further more, we are already using the same logic in the process. When the first category failed, we stop the process (in the permission validation before we doing the move). With that said, I made PR #39744 to fix this release blocker issue. Any other improvements could be done later.
Labels |
Removed:
Release Blocker
|
confirmed