When I create content as advanced user, less advanced uses, advanced enough to edit the content, can't edit my content.
Content structure:
- Node type reseller with user reference field_contact
- standard user, status disabled
- standard user, status enabled
- editor user, with edit permissions for reseller nodes
- admin user with user management permissions
Steps to reproduce
- As admin, create a reseller.
- Link both standard users to the new reseller
- As editor user, edit the reseller
- but don't change the node
- hit 'save'
An error occurs: This entity cannot be referenced.
How can it go right the first time? if disabled users are not allowed to be linked, why can I do it as admin, and why can i not edit the content with less permissions?
Please provide consistent behaviour!
Thanks! :-)
Comment | File | Size | Author |
---|---|---|---|
Edit_Reseller.png | 65.92 KB | erlendoos |
Comments
Comment #2
flyke CreditAttribution: flyke commentedI have the same issue with images.
Multilingual Drupal (8.1.8) site (English as default language, Dutch as second language).
There is a content type 'basic page' that is translatable and has an image field
- As admin, create basic page with image in default language (English)
- As content editor: edit page, do not change anything and click save: no problem
- As content editor: edit page, change language to Dutch via the language selector (NOT using translate tab) and save: no problem
- As content editor: edit page again, do not change anything (language is now Dutch in selector) and save again: Error appears: 'This entity (file: 293) cannot be referenced.'
If you have 5 image fields on the node, then you see this error 5 times (with different fileid).
It is impossible to save the node.
Even changing language back to English does not remove the errors.
As admin: no errors and you can change the language in the selector as much as you want without problem.
I cannot figure out how to resolve these errors, nor how to prevent the language from being changed (I would like to lock the language dropdown so you can see which language you are editing but cannot change it)
Comment #3
erlendoos CreditAttribution: erlendoos commentedI think this is a different issue. The place where it occurs is at
namespace: Drupal\user\Plugin\EntityReferenceSelection
class: UserSelection
function validateReferenceableNewEntities.
The combination of isActive and 'administer users' not always makes sense, and there is no way to change it's behaviour (that I know of)
Comment #7
tascI assume I got the same problem:
While I'm working on some kind of import I create a number of users and need to reference them in some created nodes.
It works as long as I'm not validating the node-entity prior to saving, otherwise I get "Entity can not be referenced".
Manually adding the (blocked) user to the content when logged in as admin however works.
Comment #10
KartagisI have the same issue with taxonomy term, on products. I have 3 entity reference fields, get the error 3 times with different terms.
Comment #13
jonathanshawOnly users with the 'administer users' permission can reference disabled users. This is by design.
If you desire a different logic, creating a custom entity reference selection handler plugin is extremely easy.