- Issue created by @cboyden
- Status changed to Needs review
7 months ago 11:45pm 11 June 2024 - πΊπΈUnited States cboyden
Here's a patch with a proof of concept that is working on a Panopoly child distribution
- Status changed to Needs work
7 months ago 3:52pm 12 June 2024 - πΊπΈUnited States cboyden
As it turns out Search API can have multiple types of entities as data sources in the same index, so it's not feasible to just assume that everything is a node. And if there are multiple data sources, they won't necessarily all have the same view modes configured. Maybe there's a way to query the search index to see if there are multiple data sources (in which case, switching view modes maybe shouldn't be allowed) or only one (in which case we need the entity type just as if it were a regular view).
- πΊπΈUnited States cboyden
This new patch is a total kludge but it does manage to get the correct view modes for a Search API view that uses a single datasource.
- πΊπΈUnited States dsnopek USA
I've spent a little time thinking about this, and I don't think we should try to make the
MagicBlock
try to work as if the View was using the underlying entity type, given that Search API indexes can hold multiple entities types. I think thatMagicBlock
should only be able to work on Views of a single particular entity type.So, I think we should focus on fixing the fatal error:
The error is happening because Search API views don't have a base entity type, so they return FALSE for
$this->view->getBaseEntityType().
If that function returns
FALSE
, thenMagicBlock
shouldn't allow changing the display type.Ideally, it'd be great if we could remove the "Display Type" option when configuring a view that isn't on an entity type, so that site builders can't even enable this option for a View that it wouldn't work on.
- Status changed to Needs review
6 months ago 3:51pm 27 June 2024 - πΊπΈUnited States cboyden
Here's a minimal patch that should keep Views blocks without an entity base table from being able to change display type. I wasn't able to figure out a way to hide the option in the Views UI, so Views can still be configured to allow changing display type, but the options won't be available on the block config if there's no base table.
- Status changed to RTBC
6 months ago 9:13pm 27 June 2024 -
dsnopek β
committed 4abcbee7 on 3.0.x
Issue #3454052 by cboyden: PHP error on Search API views
-
dsnopek β
committed 4abcbee7 on 3.0.x
- Status changed to Fixed
6 months ago 9:26pm 27 June 2024 Automatically closed - issue fixed for 2 weeks with no activity.