Anonymous simple inline entity form permission issue

Created on 2 July 2021, over 3 years ago
Updated 17 February 2024, 9 months ago

Problem/Motivation

I have a content type with a simple inline entity form field on it. Then I go to add new content and I use a form_alter on that parent content to add a previously created entity reference to the inline entity form. We basically do the following in the form_alter to add this default value.
$form['field_xxxxxx']['widget'][0]['inline_entity_form']['#default_value'] = $default_entity;
This is working for authenticated user but not for anonymous.
So I have to turn on 'Anonymous users can create xxxxx content type' in the permissions. So I basically have to give anonymous users create permission even though I have already created and saved the referenced entity. Is that a bug or is there something else I should set in the form alter when I set this default value to let inline_entity_form know that this is not a 'create' any longer? Like maybe I have to change the #op value from 'add' to 'edit' or something? Thanks for any help.

πŸ’¬ Support request
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DustinYoder

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    I'm closing old IEF support issues. Please feel free to re-open the issue if you still require assistance.

Production build 0.71.5 2024