Problem/Motivation
User gets an error when trying to reference an unpublished entity that they have just created and that he has full access to. This basically makes it impossible for a user to submit a set of unpublished interreferencing entities (e.g. artefact/architect/city).
Steps to reproduce:
- Create content type A, make sure Published is unchecked in the Publishing options.
- Create content type B, add an ER field referencing A, choose Autocomplete widget in Form display.
- Create a test user, give permissions to View own unpublished content, to Create A and B, to Edit own A and B.
- Log in as that user.
- Create a test node of type A, verify that it is Unpublished and the user can see it.
- Create a test node of type B, start typing the label of the A node just created, verify that it's not recognised and suggested by the system.
- Type the complete label and hit Save, get the "No such entity" error.
- Type the entity label followed by its nid in parentheses, still get the "This entity (node: N) cannot be referenced”
This issue also prevents the user w/ appropriate permissions from referencing unpublished entities authored by other users.
Proposed resolution
Allow referencing unpublished entities if the current user has access to them.
To implement that:
- We are adding a flag in selection handler plugin
- Based on the flag values we are checking additional permissions and allowing users to check the node
Solution approach is based on #80#82#83
Remaining tasks
- Needs review
- UX review if configured option labels isn't confusing
User interface changes
Additional option is added on the selection handler plugin settings
API changes
none
Data model changes
none