- Merge request !18Add Views EntityReference filter to be available for all entity reference fields → (Closed) created by scott_euser
- Merge request !3086Resolve #2429699 "Entity reference views filter d101" → (Closed) created by Graber
- 🇺🇸United States smustgrave
Still seeing the same error.
Also see it was tagged for change record which still needs to happen.
Will reach out for framework manager review.
- 🇺🇸United States smustgrave
Also think I may know why the test fails on drupal and not locally
/admin/structure/views/nojs/handler-extra/content/page_1/filter/field_test_target_id_reference is locally
but in drupal I bet it's
subdirectory/admin/structure/views/nojs/handler-extra/content/page_1/filter/field_test_target_id_reference
- 🇺🇸United States smustgrave
Lets try this.
Leaving in NW for change record.
Hiding files to avoid confusion
- 🇺🇸United States smustgrave
Lets try this.
Leaving in NW for change record.
Hiding files to avoid confusion
- Status changed to Needs review
almost 2 years ago 11:32am 3 February 2023 - 🇵🇱Poland Graber
https://www.drupal.org/node/3338903 → Here's a change record draft.
Not sure about it though as this is a new feature actually that doesn't affect any previous instances. Do we need a CR in such cases as well? - Status changed to RTBC
almost 2 years ago 5:11pm 3 February 2023 - 🇺🇸United States smustgrave
Add small tweak to CR to include images.
So a CR is also useful to announce new features/major changes. So announcing users can use this new feature could be helpful for some.
- 🇬🇧United Kingdom catch
The issue summary currently mentions converting the TaxonomyIndexTid filter to be based on this, but this isn't done in the patch. I don't think we should do it here, already at a possibly record-breaking 530 comments, but I couldn't see a follow-up to do that in the related issues - would be good to create that if it really doesn't exist and link it from the issue summary.
- 🇺🇸United States smustgrave
This gets any more comments I'm afraid my page won't load haha
Opened 📌 Add Views EntityReference filter to be available for all entity reference fields Closed: duplicate
- Status changed to Needs work
almost 2 years ago 10:41am 12 February 2023 - 🇳🇱Netherlands Lendude Amsterdam
@catch asked me to look at this again, mostly the test coverage. The test coverage seems mostly good, but ran into some other issues.
- calculateDependencies is untested and should be since this is different than the Term plugin
- The 'sort by' field is empty on initial adding of the filter (the field widget does something ajaxy when selecting bundles, the views widget does not, might be it?)
- Grouped autocomplete filters don't work/save (but don't work for taxonomy ref filters either), please find the related issue or open it (should be one I think)
- Description "as a Reference filter" feels a bit vague, did we get UX feedback on this?
- Should we add this new filter for taxonomy terms too, or should we skip those since it is unclear what the difference is now when have to chose between the two different filters
- I can create a circular reference by creating an Entity reference View that uses itself as the filter, not sure what goes wrong (mostly getting an empty filter after saving), but that sounds iffy
- Maybe related : Managed to click my way into "Warning: Undefined array key "reference_views" in Drupal\views\Plugin\views\filter\EntityReference->submitExtraOptionsForm() (line 440 of /app/drupal/core/modules/views/src/Plugin/views/filter/EntityReference.php)"
- Node titles in the select element are double escaped
- Exposed filters on the chosen entity reference view are also shown on the view
- 🇵🇱Poland Graber
I'm afraid a few more comments and infra will break for good. Maybe we should close this and open in a new issue with a summary? We could also choose contrib approach I took with Views Date Filter, create a core readiness issue there and merge to core when ready? Some changes seem too big for a single issue and should be handled as epics with their own sub-tasks really, otherwise we're stuck for years and end users don't see any progress.
- 🇺🇸United States smustgrave
Opened up ✨ Continuation Add Views EntityReference filter to be available for all entity reference fields Needs work and asked @catch or @lendude to take a look and see if we can close this one one out.
Moved over the changes in the MR and copied comment #534 as those need to be done.
- 🇪🇸Spain psf_ Huelva
Hi, I don't like add more noise to this issue but I think it's a related use case.
The module https://www.drupal.org/project/config_views → allow create views that query configuration entities, and I can create a new view that result all taxonomy vocabularies, for example. If I add a entity reference display to that view I can't select it in a reference field to use the view how list options.
I can't because this:
File:
web/core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php
line 141 of Drupal 10.0.9.if (in_array($view->get('base_table'), [$entity_type->getBaseTable(), $entity_type->getDataTable()])) { $display = $view->get('display'); $options[$view_id . ':' . $display_id] = $view_id . ' - ' . $display[$display_id]['display_title']; }
If I replace that code by:
$display = $view->get('display'); $options[$view_id . ':' . $display_id] = $view_id . ' - ' . $display[$display_id]['display_title'];
I can select my view, but after saving the site break with this error:
Error: Call to a member function bundle() on null in Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection->stripAdminAndAnchorTagsFromResults() (line 289 of core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php). Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection->getReferenceableEntities() (Line: 618) Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem->getSettableOptions(Object) (Line: 138) Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsWidgetBase->getOptions(Object) (Line: 34) Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsSelectWidget->formElement(Object, 0, Array, Array, Object) (Line: 349) Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 92) Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 287) Drupal\Core\Field\FieldItemList->defaultValuesForm(Array, Object) (Line: 125) Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 106) Drupal\Core\Entity\EntityForm->buildForm(Array, Object) call_user_func_array(Array, Array) (Line: 536) Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 283) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I think that fail because views only work with content entities, not with configuration entities.
- Status changed to Closed: duplicate
over 1 year ago 11:28am 24 May 2023 - 🇬🇧United Kingdom catch
Closing this as a duplicate of ✨ Continuation Add Views EntityReference filter to be available for all entity reference fields Needs work because this issue is crashing browsers at this point. Let's continue over there.
- 🇬🇧United Kingdom scott_euser
FYI committed to 11.x in the follow-up ✨ Continuation Add Views EntityReference filter to be available for all entity reference fields Needs work