Hi,

When I want to create and index flags with search api i have this error message:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'flag_name' in 'where clause': INSERT INTO {search_api_item} (item_id, index_id, changed) SELECT t.flagging_id AS item_id, :index_id AS index_id, 1 AS changed FROM {flagging} t WHERE (flag_name IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => favourite_terms [:index_id] => 24 ) in SearchApiEntityDataSourceController->startTracking() (line 198 of /var/www/horizon/sites/all/modules/contrib/search_api/includes/datasource_entity.inc

similar issue: https://www.drupal.org/node/2524314

I've created a patch for review.

CommentFileSizeAuthor
search_api-create_flagging_indexes.patch947 bytesalan-ps

Comments

alan-ps created an issue. See original summary.

  • drunken monkey committed cfc2bdf on 7.x-1.x authored by alan-ps
    Issue #2707039 by alan-ps: Fixed indexes of flag entities with "bundles...
drunken monkey’s picture

Status: Needs review » Fixed

Looks good, thanks! I haven't tested it, but if it works for you, that's good enough for me.
Committed. Thanks again!

I can't help but feel that there's gotta be a generic solution for the problem. I think there's some entity metadata telling us that bundles are based on a different entity, right? So maybe that could work.
But probably this occurs rarely enough that those one-off fixes are good enough, too.

alan-ps’s picture

Thanks for committing. I agree that we should find some general solution for all entities. I will look at this later:)

Status: Fixed » Closed (fixed)

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