First of all, thanks for this great module: it is a pleasure to use!

I have run into a minor problem that occurs when a non-admin user tries to edit for example:

http://fmysite/admin/structure/entity-type/asset/asset/1/edit

When he/she saves the form, the following error occurs:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'nid' in where clause is ambiguous: SELECT DISTINCT node.nid AS entity_id, node.vid AS revision_id, node.type AS bundle, :entity_type AS entity_type FROM {node} node INNER JOIN {node_access} na ON na.nid = node.nid WHERE (nid IN (:db_condition_placeholder_0)) AND (type IN (:db_condition_placeholder_1)) AND(( (na.gid = :db_condition_placeholder_2) AND (na.realm = :db_condition_placeholder_3) )OR( (na.gid = :db_condition_placeholder_4) AND (na.realm = :db_condition_placeholder_5) ))AND (na.grant_view >= :db_condition_placeholder_6) ORDER BY node.title ASC; Array ( [:db_condition_placeholder_0] => 19 [:db_condition_placeholder_1] => mena_case [:db_condition_placeholder_2] => 0 [:db_condition_placeholder_3] => all [:db_condition_placeholder_4] => 1 [:db_condition_placeholder_5] => view_unpublished_mena_case_content [:db_condition_placeholder_6] => 1 [:entity_type] => node ) in EntityFieldQuery->execute() (Zeile 1136 von /var/customers/webs/ICAR/forum/Server/includes/entity.inc).

Notice that the problem does not occur when logged in as administrator. I have tried enabling (for this user) all permissions under the "Entity Construction Kit" permissions category, but this didn't help.

Does anybody know where the problem might be?

Thanks for any feedback and hints,
Kaspar

Comments

hbfkf’s picture

This seems to be related to a bug in core, see http://drupal.org/node/1325628#comment-5571342.

The fix proposed in comment http://drupal.org/node/1325628#comment-5571342, to be applied to includes/entity.inc worked for me.

acrazyanimal’s picture

Status: Active » Postponed (maintainer needs more info)

Is this still an issue?

I have tested editing and creating with the latest dev both for an anonymous user and an authenticated user and do not run into this problem.

Do you have an example scenario/steps that can be taken to reproduce this?

hbfkf’s picture

Hey acrazyanimal,

Are you saying you tested it with a patched version of Drupal (patched = Drupal Core patched as discussed in #1 – IIUC the problem has not yet been fixed in the Drupal 7.14 release)?

Or do you say that you tested it with the latest version of ECK and cannot reproduce the problem?

Thanks,
Kaspar

acrazyanimal’s picture

I am not using a patched version of Drupal. Just saying I tested with the latest version of ECK and cannot reproduce. Wondering if there is something specific you're doing that I may be missing?

Also, I believe the issue mentioned in #1 should not affect ECK since it does not use the EntityFieldQuery other then what might be used within the entity api. So no EFQ->fieldcondition() which are the root of that issue.

Note: I am also using the latest dev version of Entity and Ctools as well.

fmizzell’s picture

No action for a while, closing

fmizzell’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)