- πΊπΈUnited States j_s
Also got this error recently just by removing a relationship in the UI. I have some other fields and filters that used it, and in Drupal 7 it'd fail successfully by removing the relationships where used. Core views should similarly be smarter and perform safe fallbacks instead of white-screen crashing the view with a bunch of throws.
- π¦πΊAustralia jude.hungerford
I tried manually updating HandlerBase.php and ManyToOneAdapter.php in Drupal 9.5.9, based on this merge request:
https://git.drupalcode.org/project/drupal/-/merge_requests/1624/diffs#no...
I can confirm that Views with "Is none of" filters work after this patch. Without it, the View returns a white screen with the text "The website encountered an unexpected error. Please try again later".
- πΊπΈUnited States jasonglisson
I am also getting this error on a large amount of views in our site. Basically any view that is filtering a taxonomy terms in a hierarchy or using none of. I haven't found a way past it yet. I'm on Drupal Core 9.5.10 right now but have downgraded all the way to 9.3 and this is still a problem.
- π¦πΊAustralia Ryanm81
If it helps, to get the View back after breaking if you are getting the WSOD, you can just use the 'duplicate view' button to make a duplicate.
Ofcourse you'll have to reassign the new view to existing blocks etc., but if you had some complex views you didn't want to start over from scratch like I did, this will help.
- π΅π±Poland Patryk Padus
There is another connection:
- Add field (I use Commerce module)
- Add new reference to this field in "View" -> "Advanced" -> "Reference"
- Try to remove field, it won't remove it from View and won't list it as blocked by usage.
- Get WSOD where view is used with referenced to non-exist fieldWhen re-adding issue gone and when removed issue back so this issue caused by UI and user so critical state is correct
- First commit to issue fork.
- Status changed to Needs review
about 1 year ago 11:48pm 14 November 2023 - π¨π¦Canada franceslui
Reroll of merge request 1624 for Drupal 10.1.x. These were what I did:
- changed the function name from 'testFilterGrouping' to 'testFilterGroupingWith2DifferentTerms' in my patch for the file TaxonomyIndexTidUiTest.php because the function testFilterGrouping exists in this php file in Drupal 10
- added the statement 'use Drupal\views\Plugin\views\ViewsHandlerInterface;' in my patch for the file ManyToOneHelper.php
- removed hunk #8 (the last hunk) from the original patch in merge request 1624 because the same code changes are already in Drupal 10 - Status changed to Needs work
about 1 year ago 12:08am 15 November 2023 - πΊπΈUnited States smustgrave
Have not reviewed but seems to have a test failure
PHPUnit Test failed to complete; Error: PHPUnit 9.6.8 by Sebastian Bergmann and contributors. Testing Drupal\Tests\user\Kernel\Views\HandlerFilterPermissionTest F 1 / 1 (100%) Time: 00:02.142, Memory: 4.00 MB There was 1 failure: 1) Drupal\Tests\user\Kernel\Views\HandlerFilterPermissionTest::testFilterPermission Failed asserting that actual size 0 matches expected size 3. /builds/issue/drupal-2829178/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122 /builds/issue/drupal-2829178/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55 /builds/issue/drupal-2829178/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php:65 /builds/issue/drupal-2829178/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
- π¦πΊAustralia jude.hungerford
I've tested !5321 on Drupal 10.1.5, and I can confirm that the patch applies cleanly and it fixes our View with an "Is none of" filter.
- π³π±Netherlands Lendude Amsterdam
Lendude β changed the visibility of the branch 10.1.x to hidden.
- π³π±Netherlands Lendude Amsterdam
Lendude β changed the visibility of the branch 2829178-11.x to hidden.
- π³π±Netherlands Lendude Amsterdam
I tried to rebase some stuff into 11.x but no luck Β―\_(γ)_/Β―
- πΊπΈUnited States AaronBauman Philadelphia
MR 5321 working for me on 10.1.7
- π©π°Denmark ressa Copenhagen
I just ran into this. Not using a "drop-down list", but after adding a "Relationships: term" and "Contextual filters: (term) Taxonomy term: Name" I got:
Error: Attempt to assign property "type" on null in Drupal\views\ManyToOneHelper->ensureMyTable()
errors.The !5321 patch works well, and I can separate multiple terms with
+
, like this:view_page_path/abi+dam+cog
and nodes tagged with those terms are shown.It does crash if I add a single term, with a lingering comma:
view_page_path/abi,
, or a lingering plus signview_page_path/abi+
:TypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string in Drupal\views\Plugin\views\argument\ArgumentPluginBase->unpackArgumentValue() (line 1302 of core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php).
- πΉπThailand AlfTheCat
5321 didn't work for me, in my case I tried to add an 'is one of' views filter of moderation states of a referenced node, using a relationship on the filter.
- π§πΎBelarus q2_faith
Hi there,
MR 5321 works for operator "Is one of" and doesn't work for "Is all of" but at least fixes errorError: Attempt to assign property "type" on null in Drupal\views\ManyToOneHelper->ensureMyTable() (line 220 of /var/www/html/web/core/modules/views/src/ManyToOneHelper.php).
.
I tried to figured out how to fix it but unsuccessfully. What I did(changes agains patch)- Removed
$join = $this->getTableJoin($join->table, $join->leftTable);
in HandlerBase.php in 616 line. I think it isn't necessary to join table one more time because we already did it. Additionally, it doesn't work because the condition
if (isset($data['table']['join'][$base_table])) {
never returns true in method getTableJoin.
- The second place where we call method getTableJoin is in ManyToOneHelper.php line 112. On the behalf first point we get here null as well. I added checking on null.
$r_join = HandlerBase::getTableJoin($r_join->leftTable, $base_table); if (!$r_join) { $r_join = clone $join; break; }
Now query looks properly in Views preview but doesn't return any result. Like,
INNER JOIN {taxonomy_term_field_data} "taxonomy_term_field_data_value_1" ON paragraphs_item_field_data_node__field_xxxx_xxxx__paragraph__field_xxxx_xxxx.field_xxxx_xxxx_target_id = taxonomy_term_field_data_value_1.tid AND taxonomy_term_field_data_value_1.tid = '68'
And, I don't have idea how fix it. I will appreciate for any advice.
Thanks! - Removed
- π©πͺGermany tobiasb Berlin
For the "Is none of" use case I believe this part needs to be untouched. At least then it works again for list fields.
@@ -275,8 +292,13 @@ public function addFilter() { // is set to TRUE, conditions will be added. $add_condition = TRUE; if ($operator == 'not') { - $value = NULL; - $operator = 'IS NULL'; + if (count($value) > 1) { + $operator = 'NOT IN'; + } + else { + $value = is_array($value) ? array_pop($value) : $value; + $operator = '!='; + } $add_condition = FALSE; } elseif ($operator == 'or' && empty($options['reduce_duplicates'])) {
- First commit to issue fork.
- π΅πPhilippines dsdeiz
Oh sorry, I didn't know it would automatically update the existing MR. I only added this change though - https://git.drupalcode.org/project/drupal/-/merge_requests/5321/diffs?co....
- πΊπΈUnited States xeiro
#105 fixed the issue for me (10.3.x, 8.3.). Thank you!