? ? NPM Resource Changed bug PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
2 Jun 2023

Pull Request for Issue #40690.

Summary of Changes

When passing a path variable in the browser url, the media manager should take that one to display the files instead of the one from the session.

Some system tests are also provided to make sure the combination between the session and url is playing nicely together.

This is a more lightweight alternative to the pr #40691.

Testing Instructions

  • Go to /administrator/index.php?option=com_media&path=local-images:/sampledata
  • Type in the url /administrator/index.php?option=com_media&path=local-images:/banners

Actual result BEFORE applying this Pull Request

The media manager redirects to the sampledata directory.

Expected result AFTER applying this Pull Request

The media manager shows the contents of the banners directory.

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 joomla-cms-bot joomla-cms-bot - change - 2 Jun 2023
Category JavaScript Administration com_media NPM Change Unit Tests
avatar laoneo laoneo - open - 2 Jun 2023
avatar laoneo laoneo - change - 2 Jun 2023
Status New Pending
avatar dgrammatiko
dgrammatiko - comment - 2 Jun 2023

Allen this enables a faulty behavior:

  • Goto /administrator/index.php?option=com_media&path=local-images:/notexisting you get:
Screenshot 2023-06-02 at 14 11 11 - if you try to upload a file then the folder is created and the file is stored inside it: Screenshot 2023-06-02 at 14 12 54
  • Also mind that the images folder is not expanded in the left aside navigation (this is problematic for my extension)
avatar laoneo
laoneo - comment - 2 Jun 2023

It is the same behavior as now, currently you you just have to set the invalid folder in the session.

avatar dgrammatiko
dgrammatiko - comment - 2 Jun 2023

But the session is only set by the app?

avatar laoneo
laoneo - comment - 2 Jun 2023

And when you put an invalid path in the url, then an error message is shown:
image

This pr restores the old behavior we had in 4.3.0. Changing the path to a valid one when it is invalid is not the scope of this pr and should probably be done in 5.0.

avatar laoneo
laoneo - comment - 2 Jun 2023

But the session is only set by the app?

Yes, but it doesn't mean it can't be invalid. When one user browses to a folder and then another one deletes that folder, you get the same result as with this pr when you put an invalid folder name into the url.

avatar dgrammatiko
dgrammatiko - comment - 2 Jun 2023

This pr restores the old behavior we had in 4.3.0.

This behaviour was, and after this PR is still, broken. The state of the app is not set correctly (ie there is no initial selected folder and there is no code to cope with that), in short the media manager initial state could be really harmful

avatar laoneo
laoneo - comment - 2 Jun 2023

At least you can pass again the path by url which is now not possible.

avatar dgrammatiko
dgrammatiko - comment - 2 Jun 2023

Ok, have it your way

avatar brianteeman
brianteeman - comment - 2 Jun 2023

if a non existing path now results in a success then this is not correct
if you can then write to that then its a security issue

avatar laoneo
laoneo - comment - 2 Jun 2023

This one restores the same behaviour as before #40013 which was shipped with 4.3.2. There is nothing new in there.

avatar laoneo laoneo - change - 5 Jun 2023
Labels Added: ? NPM Resource Changed bug PR-4.3-dev
72fca3f 6 Jun 2023 avatar laoneo wait
avatar joomla-cms-bot joomla-cms-bot - change - 7 Jun 2023
Category JavaScript Administration com_media NPM Change Unit Tests JavaScript Administration com_media NPM Change Repository Unit Tests
avatar dgrammatiko dgrammatiko - test_item - 22 Jun 2023 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 22 Jun 2023

I have tested this item successfully on 24418e1

The path on the URL is respected but there are quite a few inconsistencies and things should be done differently when media manager is booting. Also The store needs to be migrated to pinia. Allon is aware of this but for 4.3 this is fixing the regression


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

avatar viocassel viocassel - test_item - 22 Jun 2023 - Tested successfully
avatar viocassel
viocassel - comment - 22 Jun 2023

I have tested this item successfully on 24418e1


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

avatar Quy Quy - change - 22 Jun 2023
Status Pending Ready to Commit
avatar Quy
Quy - comment - 22 Jun 2023

RTC


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

avatar laoneo laoneo - change - 24 Jun 2023
Labels Added: ?
avatar obuisard obuisard - close - 26 Jun 2023
avatar obuisard obuisard - merge - 26 Jun 2023
avatar obuisard obuisard - change - 26 Jun 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-06-26 13:11:33
Closed_By obuisard
avatar obuisard
obuisard - comment - 26 Jun 2023

Thank you Allon @laoneo for the PR!

Add a Comment

Login with GitHub to post a comment