NPM Resource Changed bug PR-5.3-dev Failure

User tests: Successful: Unsuccessful:

avatar 3idey
3idey
19 Mar 2025

Summary

This PR improves error handling in renameItem() in the Joomla Media Manager. It replaces raw error throws with Joomla notifications, ensuring better user feedback and using Joomla's Notification System Instead of Throwing Errors

Changes Made

  • Updated renameItem() to use notifications.error() instead of throw new Error(error);
  • Ensured that errors are properly logged in Joomla’s notification system.
  • Improve File Exists Handling (Duplicate Files).

Testing Instructions

  • Open Joomla Media Manager.
  • Try renaming a file to an invalid name (e.g., same name as an existing file).
  • You should see an error notification instead of the app crashing.

Checklist

  • Code follows Joomla's coding standards.
  • Fix does not introduce new bugs.
  • Properly tested within Joomla.
avatar 3idey 3idey - open - 19 Mar 2025
avatar 3idey 3idey - change - 19 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Mar 2025
Category JavaScript Administration com_media NPM Change
avatar 3idey 3idey - change - 19 Mar 2025
The description was changed
avatar 3idey 3idey - edited - 19 Mar 2025
avatar 3idey 3idey - change - 19 Mar 2025
The description was changed
avatar 3idey 3idey - edited - 19 Mar 2025
avatar 3idey 3idey - change - 19 Mar 2025
The description was changed
avatar 3idey 3idey - edited - 19 Mar 2025
avatar 3idey
3idey - comment - 19 Mar 2025

@richard67 @laoneo can you tell me is there anything that needs to be fixed.

avatar 3idey 3idey - change - 20 Mar 2025
The description was changed
avatar 3idey 3idey - edited - 20 Mar 2025
avatar HLeithner
HLeithner - comment - 15 Apr 2025

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 15 Apr 2025
Title
Fix error handling rename item
[5.3] Fix error handling rename item
avatar HLeithner HLeithner - edited - 15 Apr 2025
avatar 3idey
3idey - comment - 21 Apr 2025

Will it be merged soon @HLeithner

avatar HLeithner
HLeithner - comment - 22 Apr 2025

@3idey thanks for the PR, please revert the package-lock.json which seems to be unrelated.

@Fedik @joomdonation can you have a look?

avatar Fedik
Fedik - comment - 22 Apr 2025

Looks good.

avatar 3idey 3idey - change - 22 Apr 2025
Labels Added: NPM Resource Changed bug PR-5.2-dev PR-5.3-dev
avatar 3idey
3idey - comment - 22 Apr 2025

Done. @HLeithner

avatar richard67
richard67 - comment - 22 Apr 2025

Done. @HLeithner

@3idey Not right. Check the changed files of your PR on GitHub: https://github.com/joomla/joomla-cms/pull/45164/files

Now you PR deletes the package-lock-json file.

You should have reverted the changes in that file, not delete that file.

avatar 3idey
3idey - comment - 22 Apr 2025

@HLeithner @richard67 what about now ? I revert the version to "5.2.1"

avatar richard67
richard67 - comment - 22 Apr 2025

@HLeithner @richard67 what about now ? I revert the version to "5.2.1"

@3idey Yes, but at the wrong place. Again: Check the changed files of your PR on GitHub here: https://github.com/joomla/joomla-cms/pull/45164/files . Then you will see that.

avatar 3idey
3idey - comment - 22 Apr 2025

@richard67 I'm so sorry for the confusion that I made. now it should be good

avatar richard67
richard67 - comment - 22 Apr 2025

@richard67 I'm so sorry for the confusion that I made. now it should be good

@3idey Yes, now it looks alright. I've allowed myself to update the branch to the base (5.3-dev), so now the PR shows only 2 changed files and no obviously unrelated changes. Please check again on https://github.com/joomla/joomla-cms/pull/45164/files if something is missing or if it looks complete to you. Thanks in advance.

avatar 3idey
3idey - comment - 22 Apr 2025

@richard67 Everything looks great. Thanks

avatar brianteeman
brianteeman - comment - 22 Apr 2025

Should this be removed now?

// @todo error handling

avatar 3idey
3idey - comment - 22 Apr 2025

@HLeithner Done.

avatar brianteeman
brianteeman - comment - 22 Apr 2025

I tried to rename an existing image to the same name as another existing image

Before This PR

image

With this PR

image

avatar 3idey 3idey - change - 9 May 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-05-09 12:02:47
Closed_By 3idey
Labels Removed: PR-5.2-dev
avatar 3idey 3idey - close - 9 May 2025

Add a Comment

Login with GitHub to post a comment