Closed (duplicate)
Project:
Field collection
Version:
7.x-1.0-beta4
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2012 at 19:28 UTC
Updated:
4 Jul 2016 at 19:52 UTC
Jump to comment: Most recent
Comments
Comment #1
designcontext commentedSo, we checked it and I can give a little bit more information:
in field_collection.module is a function field_collection_item_access. This function checks entity access and field access. Only with both values true a user can change or delete his items.
We printes out the results of this function in the profile. The function runs multiple times for one profile. For a user with no access the results are:
1. + 2. run: hostEntityType empty, field access: true, entity access: false
3. + 4. run: hostEntityType profile2, fa. true, ea true
For a user with access the function runs 6 times and everytime the both accesses are true and the type is profile2.
We found no differences between the stored data in the database.
Please, has someone an idea about this? Our site is ready - only this little thing doesn't work.
Comment #2
RobW commentedIs the number of times field_collection_item_access runs connected to the number of field collections or field collection items on a page?
Comment #3
designcontext commented4 runs with one item and with every field-collection-item two runs more. With three field-collection-items the results are:
item->hostEntityType: field_access: 1 entity_access:
item->hostEntityType: field_access: 1 entity_access:
item->hostEntityType: field_access: 1 entity_access:
item->hostEntityType: field_access: 1 entity_access:
item->hostEntityType: field_access: 1 entity_access:
item->hostEntityType: field_access: 1 entity_access:
item->hostEntityType: profile2 field_access: 1 entity_access: 1
item->hostEntityType: profile2 field_access: 1 entity_access: 1
Comment #3.0
designcontext commentedadditional information
Comment #4
jmuzz commentedStrange those field collection items don't seem to have a host type. Can you look more closely at them and see if they are missing any other information (var_export or krumo/dpm) ? Maybe you can run some backtraces to find out if there is a difference in how it is called between when the hostEntityType exists or not (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)).
Comment #5
andy tawse commentedI'm seeing this too and it seems to be related to this issue https://www.drupal.org/node/2407435
In field_collection_item_access(), if you check that $entity_access is strictly not false it seems to work (haven't done much testing outside my situation).
I had this problem with an entity reference field and they fixed their problem in a similar way - https://www.drupal.org/node/1909436#comment-7615877 (see that comment in particular).
Comment #6
jmuzz commented