We recently decided to no longer offer users the ability to edit the Title field of the entity we are editing with ief_popup.
So in that Entity's "Manage form display" tab, in the "Inline Entity Form" custom display settings, I dragged the Title field into the Disabled section.
But now when I click to edit an entity using this IEF Popup, I get this error message:
Oops, something went wrong. Check your browser's developer console for more details.
In the browser console, I see this:
Warning: Trying to access array offset on value of type null in /var/www/html/docroot/modules/contrib/ief_popup/ief_popup.module on line 213
Issue fork ief_popup-3499530
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dan3h commentedLine 213 is this:
$entity_title = $ief_form['title']['widget'][0]['value']['#default_value'];Inspecting that, I found that that
$ief_form['title']['widget']contains[ 0 => null ].$ief_form['#default_value']is set to the Node that is being edited. As such, line 213 can be changed to:$entity_title = $ief_form['#default_value']->get('title')->value;This is in the 'edit' action. The 'duplicate' action looks to be handled identically, and so I've included the same fix for that.
Comment #4
chrisckComment #6
chrisckLooks good! Thank you @dan3h for your contribution.
Comment #7
chrisckComment #8
chrisckComment #9
chrisck