-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
[MODX 3] Media browser uploads file to incorrect path when media source is changed #16532
Comments
This issue has been mentioned on MODX Community. There might be relevant details there: https://community.modx.com/t/binary-static-resources-not-downloading/7555/8 |
On 3.1.0-dev I'm not seeing this happening. Can you create a video capture of your process of reproducing the issue? Also, a screen grab of the media source setup would help as well. |
Yes, it looks like this issue is fixed in the current version that's under development.
|
Bug report
Summary
Under certain conditions, the media browser uploads files to the wrong path after the media source is changed.
Step to reproduce
assets/images/
.)assets/images/blue.png
.)assets/images/
), the file is uploaded to the directoryassets/images/assets/images/
.Cause of the error
In the media browser code, when the media source is changed, the active node is set to an empty string:
this.cm.activeNode = '';
revolution/manager/assets/modext/widgets/system/modx.tree.directory.js
Lines 270 to 274 in f197da7
Now when a file is uploaded and the active node is empty, the code uses the value of
this.config.openTo
for the path (which is set to the path of the file that was selected when the media browser was opened.)revolution/manager/assets/modext/widgets/system/modx.tree.directory.js
Lines 749 to 751 in f197da7
Possible solution
In the media browser code, after the media source is changed, set the active node to the root node of the media source.
revolution/manager/assets/modext/widgets/system/modx.tree.directory.js
Lines 273 to 274 in f197da7
Environment
MODX 3.0.4-pl.
The text was updated successfully, but these errors were encountered: