Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297268

VIew with exposed filter(s) passes through form state values to the pager

$
0
0

What are the steps required to reproduce the bug?
Using a standard install of Drupal 8.0.x, add the existing field_tags to basic page content type.
Create 3 pieces of content, 2 with the same tags. E.g. "Apple" and "Banana" tagged "fruit", "Carrot" tagged "vegetable".
Configure a view of basic pages, 1 item per page and add an exposed filter by tag, use path "/food".
Now go to /food. Great, 3 pages of content!

Now filter by tag "fruit". Great 2 pages of content and the tags filter says "fruit (1)".
URL: http://localhost/drupal/food?tags=fruit+%281%29

Now click on page 2. Huh? 3 pages of content and the tags filter says "Array".
http://localhost/drupal/food?tags%5B0%5D%5Btarget_id%5D=1&=Apply&page=1

What behavior were you expecting?
I expect the url parameters to be the same format as the first page when I click on page 2.
I expect the filter to maintain the selected value and apply it to the views query.

What happened instead?
I ended up with PHP warnings and a notice, the filter lost its value and the filter stopped working.

Four log entries are created from this issue:

Warning: mb_strlen() expects parameter 1 to be string, array given in Drupal\Component\Utility\Unicode::strlen() (line 290 of /home/michael/projects/drupal/core/lib/Drupal/Component/Utility/Unicode.php).
Warning: preg_match_all() expects parameter 2 to be string, array given in Drupal\Component\Utility\Tags::explode() (line 30 of /home/michael/projects/drupal/core/lib/Drupal/Component/Utility/Tags.php).
Warning: array_unique() expects parameter 1 to be array, null given in Drupal\Component\Utility\Tags::explode() (line 31 of /home/michael/projects/drupal/core/lib/Drupal/Component/Utility/Tags.php).
Warning: Invalid argument supplied for foreach() in Drupal\Component\Utility\Tags::explode() (line 34 of /home/michael/projects/drupal/core/lib/Drupal/Component/Utility/Tags.php).
Notice: Array to string conversion in Drupal\Core\Template\AttributeArray->__toString() (line 79 of /home/michael/projects/drupal/core/lib/Drupal/Core/Template/AttributeArray.php).

Viewing all articles
Browse latest Browse all 297268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>