Hi and thank you very much for this great module! We love it!

I just encountered the problem that the search form doesn't filter in the root directory. In all sub directories the search works and reduces the results, but not in the root, where it would be most important to search all items.

We're using the "Show all files in root directory" option.

Comments

Anybody created an issue. See original summary.

ytsurk’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

Thank you for reporting this bug. I can reproduce, it's only happening when the show all files in root directory option is checked.
The problem was that the views arguments got in the same group, so I force a new group for the name search always.

ytsurk’s picture

anybody’s picture

Status: Needs review » Needs work

What that went fast, thank you ytsurk! :)

ParseError: syntax error, unexpected ',', expecting ')' in Composer\Autoload\includeFile() (Zeile 81 in /modules/contrib/media_directories/modules/media_directories_ui/src/Plugin/views/argument/StringContainsArgument.php)

After fixing this manually (removing doube comma), it works perfectly.

This is the wrong patch result:

$this->query->addWhereExpression($last_group +1, , "$this->tableAlias.$this->realField $operator $placeholder" . $null_check, [$placeholder => '%' . $this->argument . '%']);

So after fixing this, this can be committed to dev, I guess.

BTW, I think you referenced the wrong issue (self) in #3?

ytsurk’s picture

Yeah .. sorry for the faulty patch .. we need to handle the grouping in the directories argument to be totally save here ..
I will provide a new patch soon

ytsurk’s picture

Assigned: Unassigned » ytsurk
ytsurk’s picture

Assigned: ytsurk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.31 KB

So here we go with a group change where it is really needed. This makes the core media(_library) views arguments (name, type) and media_directories filter work again.

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Works perfectly! Thanks a lot! Ready to be committed!

  • ytsurk committed 21a64d1 on 8.x-1.x
    Issue #3124938 by ytsurk, Anybody: Filtering and arguments for view to...
ytsurk’s picture

Title: Filtering (search field) does not work in root directory » Filtering and arguments for view to not work with the all_files_in_root option
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.