Hi,
I have enabled allow multiple values check box in configuration. when I pass 2(Tags-1+Tags-2) or 1(Tags-1) taxonomy term in contextual filter which breaks the functionality. If the check box is not enabled, single term in contextual filter is working fine. Please find the screenshots.

Screenshots:

Multiple Value Check box configuration
Multiple Values Configuration

Multiple Value in parameter
Multiple Values in parameter

Single parameter with allow multiple value checked
Single parameter with allow multiple value checked

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Anishnirmal created an issue. See original summary.

anishnirmal’s picture

Status: Active » Needs work
saranya ashokkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.59 KB

Hello Anishnirmal,

Use this patch to solve it.

dioni’s picture

Hi

Patch fails when no arguments are provided:

Drupal\Core\Database\InvalidQueryException: Query condition 'tn.tid IN ()' cannot be empty.

With this piece of code ('if' condition) you fix the problem:

    if (empty($tids)) {
      return FALSE;
    }
  
  // Rest of code.
  $subquery = db_select('taxonomy_index', 'tn');
  $subquery->addField('tn', 'nid');
  $where = db_or()->condition('tn.tid', $tids, $operator);
  $last = "tn";
  ..................
rakesh.gectcr’s picture

#4 I think fixes the problem .

saranya ashokkumar’s picture

Hi,
I have updated the patch. Please review.

pookmish’s picture

#6 failed to apply. i manually applied and rerolled the patch.

rakesh.gectcr’s picture

Cane we get the interdiff for this ?

rakesh.gectcr’s picture

@here Kindly please add the interdiff file also with patch so that reviewer can review easily

Please see https://www.drupal.org/documentation/git/interdiff

rakesh.gectcr’s picture

Status: Needs review » Needs work
pookmish’s picture

StatusFileSize
new4.31 KB

Sorry. i must have forgotten.

amaisano’s picture

The same problem occurs with 8.x-6.x-dev. Does this patch work for that?

pookmish’s picture

Status: Needs work » Needs review

@amaisano I just tested this out and it works on 6.x-dev version for me. I encountered the same issue, applied the patch and got correct results.

amaisano’s picture

Has this been rolled into the latest dev release yet?

pookmish’s picture

This has not been added to the latest dev. I've re-rolled the patch. Its almost entirely different than the patch in #7 but the resulting queries are the same. Because of the changes on the dev branch, I can't generate an interdiff.

pookmish’s picture

StatusFileSize
new4.16 KB

Fixing my own errors. #15 wasn't using the correct logic with that path_cleaner service.

pookmish’s picture

StatusFileSize
new4.04 KB

Rerolling for 6.0-alpha2 release

rakesh.gectcr’s picture

Version: 8.x-1.2 » 8.x-6.x-dev
Issue tags: +Needs reroll
rakesh.gectcr’s picture

Status: Needs review » Needs work
vsujeetkumar’s picture

Assigned: Unassigned » vsujeetkumar
vsujeetkumar’s picture

Assigned: vsujeetkumar » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new3.99 KB

Re-roll patch created, Please review.

jaykandari’s picture

Issue tags: +DIACWAug2020
ankit maurya’s picture

rakesh.gectcr’s picture

Thanks every one for the contribution. Can we just hold this until https://www.drupal.org/files/issues/2020-09-28/2909061-33.patch get committed then we can reroll this one.

rakesh.gectcr’s picture

pookmish’s picture

StatusFileSize
new4.2 KB
new514 bytes

I've been using the patch from #21 for awhile and just noticed that using percona database, subqueries are handled completely different.

https://www.percona.com/blog/2010/10/25/mysql-limitations-part-3-subquer...

I've updated the patch to just run the subquery first and use the results raw. It's not good on performance, but it seems to be the only option for Percona databases such as on Acquia hosting.

pookmish’s picture

StatusFileSize
new4.23 KB
new536 bytes

Adding a check for an empty ids. since doing `WHERE foo IN ()` produces an error.

pookmish’s picture

StatusFileSize
new4.31 KB
new645 bytes

Correct the logic when no ides are present

pookmish’s picture

StatusFileSize
new934 bytes
new4.46 KB

Fixing warning errors.

pookmish’s picture

StatusFileSize
new4.56 KB
new1008 bytes

I should've ran my tests first.

rakesh.gectcr’s picture

Hi @pookmish,

Thanks for the great work on this issue. Is it possible for you to fork and create a PR for the same? If you are in Drupal Slack please give me a ping would love to chat about the same.

Thanks
Rakesh James

pookmish’s picture

Version: 8.x-6.x-dev » 7.x-dev

megha_kundar’s picture

StatusFileSize
new4.3 KB

Re-rolled to 7.x version

DYdave made their first commit to this issue’s fork.

dydave’s picture

StatusFileSize
new4.54 KB

Hi everyone,

Thank you very much for raising this issue and for contributing patches, it's greatly appreciated.

See at #35 the reroll of the MR from this issue fork:
https://git.drupalcode.org/project/views_taxonomy_term_name_depth/-/merg...

Additionnally, please find attached corresponding patch file:
2877249-allow-multiple-values-36.patch

The patch was applied successfully with composer and tested with the following versions:

  • views_taxonomy_term_name_depth: 7.1.0
  • Drupal: 9.4.3
  • pathauto: 1.10.0

 
Feel free to let us know if you encounter any issues, have comments or questions, any feedback would be welcome.
Thanks in advance.

tnfno’s picture

This fix never made it to 7.2.0, merge request failed. And the patch cannot be applied to 7.2.0... Any chance for a patch that works with 7.2.0 or a new release where this is included?

joegl’s picture

This has been working for us although an update is needed for 7.3.1. Any chance we can get this merged soon?

joegl changed the visibility of the branch 2877249-allow-multiple-values to hidden.

joegl changed the visibility of the branch 2877249-allow-multiple-values to active.