Problem/Motivation
Sorry for the probably dumb question Scott, but after reading through the issues and code and seeing #3347343: Add Views EntityReference filter to support better UX for exposed filters I'm not totally sure if this module already supports base fields?
As written in the related documentation issue, my concrete case is from Drupal Commerce Product Variations:
// The product backreference, populated by Product::postSave().
$fields['product_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Product'))
->setDescription(t('The parent product.'))
->setSetting('target_type', 'commerce_product')
->setReadOnly(TRUE)
->setDisplayConfigurable('view', TRUE);
With this module and the patch the filter still doesn't change.
Maybe the (non-)support for base fields should also be documented on the project page?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
anybodyComment #3
anybodyOr is this a very special case that needs custom implementation in Drupal Commerce?
Comment #4
scott_euser commentedAt the moment its just finding field configs: https://git.drupalcode.org/project/views_core_entity_reference/-/blob/1....
But if you could add some way to load up the various entity types available in a site, check their definitions for entity reference fields, similar auto-opting in could be made for base fields that are entity references.
Comment #5
scott_euser commentedJust to note base fields can be a bit more dangerous as its possible Core has replaced some base field filter handlers (e.g. language) with purpose-built filter handlers. So it may be that you'd want to opt-in to specific fields (see example on module homepage) rather than a blanket opt-in of base fields.
Comment #7
psf_ commentedHi, I will try to add base fields support. : )
Comment #9
psf_ commentedI have it working in D10.4.3 : )
Comment #10
psf_ commentedI think that only need tests.
Comment #11
psf_ commentedHi, I tried my patch in D11.1, and it didn't work. I see that the field data is in the
<entity>_field_datatable, but in D10.4, it is in the<entity>table.Is it accurate?