when investigating #1084426: Fetch Entity by property won't work for all properties, i found out, we have query callbacks for node, but none for taxonomies.

the attached patch, adds it for all taxonomy properties. but i don't know, if this is the right way to fix it!

Comments

dasjo’s picture

Status: Active » Needs review

maybe instead, 'query callback' => 'entity_metadata_table_query' should be set by default?

fago’s picture

Title: Add taxonomy query callbacks » Improve entity property query support
StatusFileSize
new21.33 KB

Yep, we really need to add that metadata for all core entities.

>maybe instead, 'query callback' => 'entity_metadata_table_query' should be set by default?
Hm, no we can't do that as not every entity appears in the schema and entities need not be based upon sql at all.

However, I think it makes sense to improve that to denote the 'schema field' from which the property origins. In that case, we can default to 'entity_metadata_table_query' for the query callback + the views controller for entities provided with the entity CRUD API can use that information too (instead of the currently used 'views field').

I've implemented that + improved the metadata accordingly. Also I've fixed querying for entities such that only the ids are passed on to the query callbacks.

Patch attached. Please test.

3rdLOF’s picture

Patch worked for me.

fago’s picture

Status: Needs review » Fixed

committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.