Closed philsward closed 2 years ago
No idea if this is right, but it gets rid of the error. And makes the layout pull through ajax where-as before I had to physically save the page to get the Select a layout to take.
Adding $layout = new StdClass(); to line 1566 of /ds/includes/ds.field_ui.inc seems to make things work.
// Load the layout preview form
$layout = new StdClass();
$layout->layout_options = $layout_options;
_ds_field_ui_table_layouts_preview($form, $form_state, $ds_layouts, $layout, $entity_type, $bundle, $view_mode);
...
Additional testing appears that the location of $layout = new StdClass (); in line 1566 isn't the right fix. The error is gone, however I couldn't get the layout to save.
Instead, this needs to be added starting at line 1558
'#weight' => -100,
);
$layout = new stdClass();
$layout = ds_get_layout_settings($entity_type, $bundle, $view_mode);
if (!empty($layout) && isset($layout->layout) && isset($ds_layouts[$layout->layout]) && empty($layout->disabled)) {
$layout->settings = $layout->settings;
$layout->regions = $ds_layouts[$layout->layout]['regions'];
$form['#ds_layout'] = $layout;
}
// Load the layout preview form
$layout->layout_options = $layout_options;
_ds_field_ui_table_layouts_preview($form, $form_state, $ds_layouts, $layout, $entity_type, $bundle, $view_mode);
Things appear to be working correctly now from this change.
Testing looks pretty good. I'm having problems getting font_awesome_field to save the formatter and (ds extras) ds template, but I have to wonder if it's related to the font awesome field module...
@philsward I made a commit that I think will fix the issue. Could you try testing to see if it works for you?
@hosef so far, no errors :-)
Looks good to me.
When Select a layout is set to - None -, the following error appears:
Setting the Select a layout to anything other than - None - and saving the page, will remove the errors.
Installing DS and DS UI, then navigating to any "Manage Display" page and configuring a display will present the error.
PHP 7.4.24