Skip to content
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

MediaBrowser allowedFileTypes is empty #14604

Closed
sdrenth opened this issue Jun 14, 2019 · 3 comments · Fixed by Sterc/revolution#17
Closed

MediaBrowser allowedFileTypes is empty #14604

sdrenth opened this issue Jun 14, 2019 · 3 comments · Fixed by Sterc/revolution#17
Labels
bug The issue in the code or project, which should be addressed.
Milestone

Comments

@sdrenth
Copy link
Contributor

sdrenth commented Jun 14, 2019

Bug report

Summary

When having a mediasource and setting the allowedFileTypes to jpg,jpeg,png,gif,psd,ico,bmp,svg,doc,docx,pdf,vcf. I still see files which should be hidden. While debugging I found out that the allowedFileTypes property in the processor is empty:

action: browser/directory/getfiles
prependPath: 
prependUrl: 
source: 3
allowedFileTypes: 
wctx: web
dir: 

So I did a console.log inside modx.browser.js on line 39:

console.log(config);

Which outputs:
{xtype: "modx-browser-view", onSelect: {…}, source: "3", allowedFileTypes: "", wctx: "web", …}
allowedFileTypes: ""
baseParams: {action: "browser/directory/getfiles", prependPath: null, prependUrl: null, source: "3", allowedFileTypes: "", …}
closeAction: "hide"
........

Step to reproduce

  1. Set the allowedFileTypes property of a mediasource to: jpg,jpeg,png,gif,psd,ico,bmp,svg,doc,docx,pdf,vcf
  2. Add for example a .gitignore file into one of the directories of the source
  3. Now you see that the .gitignore file is still visible

Observed behavior

I still see the .gitignore files and other files which are not included in the allowedFileTypes property of the mediasource. And I also noticed that the property is an empty string in the config in ExtJS, while that should contain the same value as configured in the media source.

Expected behavior

I expected the .gitignore files to not be visible anymore and also the allowedFileTypes ExtJS property to have the same value as configured in the media source.

Environment

MODX 3

@sdrenth
Copy link
Contributor Author

sdrenth commented Aug 6, 2019

Also see this screenshot which calls the getlist processor:

Screenshot 2019-08-06 at 14 11 53

@JoshuaLuckers JoshuaLuckers added bug The issue in the code or project, which should be addressed. state/confirmed labels Aug 6, 2019
@JoshuaLuckers JoshuaLuckers added this to the v3.0.0-alpha milestone Aug 6, 2019
@JoshuaLuckers
Copy link
Contributor

After reproducing this issue I noticed that the file tree handles this correctly but the Media Browser doesn't.

@opengeek opengeek modified the milestones: v3.0.0-alpha2, v3.0.0-alpha3 Jan 29, 2020
JoshuaLuckers added a commit that referenced this issue Apr 4, 2020
Merge remote-tracking branch 'upstream/pr/15046' into 3.x

* upstream/pr/15046:
  Changed order of array_merge to have the mediasource value to remain. Fixes #14604
@JoshuaLuckers
Copy link
Contributor

The PR to resolve this this issue has been merged, therefore I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue in the code or project, which should be addressed.
Projects
None yet
3 participants