Hey Damien,
Just somewhat reopen first part of #1291422: Add support for the Title module. It's broken regardless access control as you supposed. So what happens with i18n:
1. English node
2. Spanish node
3. Referred node (lang neutral).
You can perfectly enter (3) in Eng. node. And the field auto syncs fine to Spanish. Ref (autocomplete) field looks like: Bachata Basic Dance Step (279)
.
But when you try to edit->save Spanish you'd get ann error: The referenced entity (node: 279) is invalid
.
And to polish it all, nothing happens if you try to enter the same node manually. Autocomplete picks nothing. And no errors in the log.
Comment | File | Size | Author |
---|---|---|---|
#5 | skip_node_access_check_if_already_done-1332262-5.patch | 1.58 KB | colan |
Comments
Comment #1
colanFixing title & adding tag.
Still investigating, but it only happens from the non-default language interface. So if English is the default language, and you're looking at the English interface, when you edit the French version (for example) and save, it's fine. The problem occurs when you're editing the French translation through the French interface, and then try to save it.
Comment #2
amitaibuCan you provide a simple step by step on how to reproduce (you can even attach a db dump with the initial setup).
Comment #3
colanWhat I've discovered so far is that if the following is commented out, it works fine:
So it appears to be a problem with node access permissions. I haven't got any further than that at this point.
Comment #4
colanAnother thing I just discovered: It doesn't matter if it's a translation being added/edited. I just tried creating new content from the French interface (choosing any language for the content), and the same thing happened. It didn't accept anything. Using the same initial characters, the auto-complete field didn't return any results from the French (non-default) interface of the create form while it did from the English (default) side.
Comment #5
colanIt appears as though this security check is unnecessary in an EntityFieldQuery. According to the API, "[n]ode access control is performed by the SQL storage engine but other storage engines might not do this." This is further supported by Damien's comment over at How to bypass node_access when using EntityFieldQuery? For details on how this came to be, see the discussion and patch for #860180: Entity listing and loading does not allow for node access.
I've therefore removed it under these conditions. The additional check appears to mess things up.
Comment #7
colanI think that should have been on the dev branch, sorry.
Comment #8
colan#5: skip_node_access_check_if_already_done-1332262-5.patch queued for re-testing.
Comment #10
renat CreditAttribution: renat commentedJust in case some of you do not know, there were a tip posted in original "Add support for the Title module" issue. It completely solves problem mentioned in topic-starting message here. Though, in case proposed patch can improve module architecture, it would be great to finish it.
Comment #11
colanI was about to re-roll this for the latest code in the dev branch, but I can no longer reproduce it. It seems as though it was fixed though other means. Please reopen if I'm missing something.
Comment #13
donquixote CreditAttribution: donquixote commentedI experienced this issue myself, on a (single-value) entityreference on a taxonomy term referencing a user.
I managed to fix it by re-saving the field configuration.
It seems that sometimes parts of the field configuration are lost.
It reminds me of this one, #1825256-39: Does not work for Organic groups og_group_ref field
Comment #14
lorenz CreditAttribution: lorenz commentedI had the same problem and the solution was to enable translations for the entity reference field. This was not the case as I recently upgraded from content translation to entity translation.
If you are experiencing the same problem, try this:
- go to the field settings of the entity reference field
- click "enable translations" link at the bottom of the edit form
Comment #15
MustangGB CreditAttribution: MustangGB commented