- when an authenticated user submits a new node we are using the field collection module to collect the "presenter" information (all good here)
- when an authenticated user views a node s/he has submitted they can see some fields but not others - this is where the first problem is
- when an authenticated user edits his/her node s/he can NOT edit any information in four fields in the field collection but can edit three other fields - this is where the second problem is
We have tried editing the permissions in the field collection settings and we have tried editing the permissions in the content type. We have also looked at the permissions for the authenticated user role and confirmed that when we edit the permissions in those other two areas it is checking and unchecking the boxes in the role for the corresponding permissions. However, even when the user has been granted the permission to edit those fields, s/he can not do so.
We are using the field collection module in tandem with the field permissions module and they don't seem to work in coordination. I am also posting this text as a bug on the field permissions module. We are using this in a production environment and need a very quick fix. We are willing to sponsor the fix or offer a bounty to anyone who is willing to help us resolve the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | Permissions_FC_fields_premium.png | 199.03 KB | thulenb |
| #24 | Permissions_embedded FC.png | 302.26 KB | thulenb |
| #20 | field_collection_entity_access.patch | 4.35 KB | lazzyvn |
| #13 | field_collection-ownerless_fields-1838976-12.patch | 601 bytes | chegor |
Comments
Comment #1
kscheirerWell, you probably haven't gotten the quick fix. You may want to post in http://groups.drupal.org/jobs and/or the http://drupal.org/paid-services forum and link to this issue if you still need one. This module's issue queue could be described as voluminous.
Comment #2
jay.lee.bio commentedKnowledges33ker, were you able to find someone to sponsor the fix?
Comment #3
kscheirerCan you provide more detail on how to reproduce this bug?
Comment #4
jay.lee.bio commentedKarl, I'll provide a live example of a feature I'm trying to finish: http://temp.collectiboard.com/node/175 (look for "Price History")
My site is a pinboard for collectibles, and Price History provides collectors with a crowdsourced database of the price history of each collectible item so that they can estimate the current value and help them figure out how much they should be paying (similar to Zillow's "Zestimate" feature). Done via Field Collection & Field Permissions, it's supposed to let any registered member submit, edit & delete their own price information.
Steps to reproduce the bug (or more of an explanation of what exactly the problem is):
1) admin/reports/fields/permissions -> No matter what permissions I set to all fields related to Field Collection (this includes all fields that are "field_collection_item" under "Entity Type" & the one field that is "Field collection" under "Field Type"), only the author of the node can submit price information. The permission settings just don't work like they should.
2) admin/people/permissions -> If I check "Authenticated User" for "Administer field collections" under "Field Collection", then any registered member can submit, edit & delete all price history information. Not that I'm supposed to be checking this field to begin with, but I'm just letting you know that this is one of the redundant tests I performed just to see what happens.
If any maintainer wants to play around with my test site, email me at jay AT jayl DOT ee and I will gladly provide user 1 access (I already gave access to Bill Bostick, who's helping me solve another problem).
Comment #5
albert volkman commentedRelated #1954124: Fields part of field collection are ownerless
Comment #6
Daniel Schaefer commentedWhat is the progress on this? Any chance field permission module will ever play with field collections?
Comment #7
ikeigenwijs commentedStill not working
Comment #8
mr_scumbagCan confirm that a user can edit the fields even when they don't have edit permissions for the node the field collection is part of.
Comment #9
softwarebloat commentedI have the same issue...
i set a permission to a field that is contained in a field collection and it doesn't work!
can you please fix this??
Comment #10
jmuzz commentedIt's not a bug in field collections, it's because the field permissions module assumes that whatever entity it is operating on will have an owner identified by its UID. Field collections do not have UID's or owners. Entity's are not guaranteed to have either, so it's really not a sound assumption.
Anyways, the real work on this problem is being done in #1954124: Fields part of field collection are ownerless. I almost want to close this one as a duplicate, but they are technically not the same issue.
Comment #11
jmuzz commentedComment #12
webservant316 commentedYeah just hit this snafu today.
field_collections does not work with field_permissions.
Fortunately, patches exist to fix it.
https://www.drupal.org/node/1954124#comment-10626332
+
https://www.drupal.org/node/1284016#comment-8433843
Hopefully the field_collections and field_permissions maintainers are on board with the patches.
Comment #13
chegor commentedThis issue fixed in dev version of "field permissions" module. So, all what we need - to patch Field collection.
Patch attached and tested on live project.
Comment #14
meramo commentedWorks for me and see no problem in the code and logic. If you have some concerns let's update the stats again.
Comment #15
jmuzz commentedThis seems to be the right idea but it will have to handle nested field collections too.
Comment #16
hkovacs commentedpatch #12 and current dev version of field_permissions solved it for me.
thank you.
Comment #17
joelpittetThis seems to be the right approach. Regarding #15, can you explain how it needs to handle nested field collections, maybe that could be a follow-up as it seems to be just something you could expand on this?
Comment #18
webservant316 commentedrecursion will be part of the solution :-)
Comment #19
jmuzz commentedThanks for the comments.
mariacha1 has decided to provide the support for this in field permission. The latest dev version of field permission includes this hook implementation and it should work without any further changes to field collection.
http://cgit.drupalcode.org/field_permissions/commit/?id=7823ec0
I made a followup to support nested field collections in the field permission issue queue.
Comment #20
lazzyvn commentedI try all dev version field permission and field collection it doesn't work
i think in when fc use function entity_access must add $account
and in function field_collection_item_access it have to change field permission if not in form edit it will call op = update and type = node
Comment #21
lazzyvn commentedComment #22
lazzyvn commentedComment #23
thulenb commentedI have tried to get field collection and field permission working together but haven't had success with the latest dev versions of the modules.
My case:
The field collection field is embedded in my content type 'profile' and has the 'public' permissions. The field collection contains several fields and I try to grant access for fields A-F to user role 'premium'. User role 'standard' should be able to access fields A-C. Therefore, I assign fields A-C the 'public' permission and fields D-F the custom permission and grant access only for the 'premium' role. Other than expected, a 'premium' user doesn't see fields D-F, only A-C.
Can somebody help me here, please? I read throught the issues and thought that this bug was fixed. I also tried to apply the patch from #13 but it doesn't work either (maybe I applied the patch not correctly because it seems not be fit for the current dev version).
Any help is much apprechiated, thanks.
Comment #24
thulenb commentedThe two screencasts show my permissions settings. The 'Public' permission is used for the embedded field collection item and the custom permission is used for the 'premium' fields.
Maybe one aspect that I forgot to mention: My problem is that the premium fields don't appear on the node edit form, although the 'premium role' has permission to create own value.