I have a field collection that contains 2 text fields and 2 image fields.
In the "manage display" tab is activated "one column" first and added some div fieldgroups.
Then I switched to "fluid 2 columns" and hit "Save". I realized that in fact I was needing "fluid 2 columns stacked" so I switched to it.
I got a warning that the layout is missing and then the page didn't load anymore.
Ever since, when I try to visit admin/structure/field-collections/mycollectionname/display, the CPU load goes 100% and I get an "almost" blank page. Please see attached screenshot.
Is there a way to restore the working view (one column) without visiting the "manage display" tab?

CommentFileSizeAuthor
#8 2541786-8.patch1.28 KBaspilicious
DS.jpg48.26 KBMihaiMiculescu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aspilicious’s picture

Could you look at the server error logs? Without that information it is hars to help.

aspilicious’s picture

DS settings are stores in the DB, you van try to delete the appropriate DS field settings or DS layout settings records.

MihaiMiculescu’s picture

In reply to #1:
I'm on a cpanel hosting service. The error log is clean.
However, the error log of the Drupal install contains some notices:
1.
Location system/ajax
Referrer admin/structure/field-collections/mycollection/display?render=overlay
Message Notice: Undefined index: ds_layouts in _ds_field_ui_table_layouts_preview() (line 1939 of sites/all/modules/ds/includes/ds.field_ui.inc).
2.
Location system/ajax
Referrer admin/structure/field-collections/mycollection/display?render=overlay
Message Notice: Undefined index: ds_layouts in _ds_field_ui_table_layouts_preview() (line 1940 of sites/all/modules/ds/includes/ds.field_ui.inc).
3. (four times, one after the other)
Location admin/structure/field-collections/mycollection/display?render=overlay
Referrer admin/structure/field-collections/mycollection/display?render=overlay
Message Notice: Undefined index: name in _field_ui_reduce_order() (line 81 of modules/field_ui/field_ui.admin.inc).
4.
Again 1 and 2 one after the other.
Hope this helps

MihaiMiculescu’s picture

In reply to #2 - could you please be more specific? What exactly am I looking for to delete?
Thanks!

aspilicious’s picture

Well look at the tables: ds_layout_settings and ds_field_settings

And look for the records that match your view mode that has issues. (look at the ID column)

Arvoreen’s picture

I'm running into the exact same problem. I went to both ds_layout_settings and ds_field_settings and removed the rows for the display type/content type that is having problems. I then go back into the UI to configure the display and as soon as I select the 'Three column (25/50/25)' layout, I get the errors on lines 1939 and 1940 of ds.field_ui.inc

Arvoreen’s picture

Actually, after some quick testing, it seems selecting ANY of the layouts that have a 'css => TRUE' setting in ds.registry.inc seems to trigger the problem. So the two 1 column layouts are fine, all the rest have the error.

aspilicious’s picture

Status: Active » Needs review
FileSize
1.28 KB

It's strange that you're experiencing UI failures because of those notices.
But you're right there is a problem with those lines.

Can someone test the following patch?

jdanthinne’s picture

Patch ok for me.

ExTexan’s picture

Just FYI, it appears that this part of the patch...

@@ -1936,9 +1939,6 @@ function _ds_field_ui_table_layouts_preview(&$form, &$form_state, $ds_layouts, $
         if (isset($layout->settings['layout_disable_css'])) {
           $disable_css = $layout->settings['layout_disable_css'];
         }
-        if (isset($form_state['values']) && $disable_css !== $form_state['values']['additional_settings']['ds_layouts']['preview']['info']['settings']['disable_css']) {
-          $disable_css = $form_state['values']['additional_settings']['ds_layouts']['preview']['info']['settings']['disable_css'];
-        }
  
         $form['additional_settings']['ds_layouts']['preview']['info']['settings']['disable_css'] = array(
           '#type' => 'checkbox',

...made it into v2.11, but this part...

@@ -774,6 +774,9 @@ function ds_field_ui_layouts_save($form, &$form_state) {
     if (isset($form_state['values']['additional_settings']['preview']['info']['settings']['disable_css'])) {
       $record->settings['layout_disable_css'] = $form_state['values']['additional_settings']['preview']['info']['settings']['disable_css'];
     }
+    else {
+      $record->settings['layout_disable_css'] = FALSE;
+    }
 
     $record->settings = $record->settings;

...didn't.

Arne Slabbinck’s picture

Thanks! Patch #8 seems to resolve following notices in DS 7.x-2.11:

Notice: Undefined index: ds_layouts in _ds_field_ui_table_layouts_preview() (line 1939 of /home/medicare_dev/drupal/modules/ds/includes/ds.field_ui.inc). =>

Notice: Undefined index: ds_layouts in _ds_field_ui_table_layouts_preview() (line 1940 of /home/medicare_dev/drupal/modules/ds/includes/ds.field_ui.inc). =>

They appeared when trying to switch from 'no layout' to 'Two column layout' (on a pretty old site)

aspilicious’s picture

Status: Needs review » Fixed

This is part of latest dev version.

aspilicious’s picture

Forgot to push.
NOW in dev :)

karimiehsan1819’s picture

Hi. i am new in drupal how could i patch it???

aspilicious’s picture

On the project page you can download development versions.
OR
https://www.drupal.org/patch/apply

karimiehsan1819’s picture

hi , thanks , i download development version of Display Suite and extract it and replace ds.field_ui.inc of development version with v2.11, am i right ?

aspilicious’s picture

OR you apply only this patch
OR you copy the entire de version, not only that file, the de version contains more fixes than just this one.

karimiehsan1819’s picture

i just ds.field_ui.inc and i got problems such as fields go out of responsive view and administer menu come late and ... why should i do ?

aspilicious’s picture

Remove the entire folder and replaced it with the 8.x—2.x–download.

Or just revert your changes and wait for a new stable release.

Always run update.php and clear your caches after patching/upgrading modules. And don't do stuff like this in production without testing...

karimiehsan1819’s picture

but i use D7 how can i use 8.x—2.x?

aspilicious’s picture

Sorry was a typo, should be 7.x—2.x dev...

karimiehsan1819’s picture

i did it but i lose responsive view ,why?

aspilicious’s picture

Sorry I can't help you with that.
Chances are small that your issue with responsiveness is caused by DS.

It's probably a theming issue, if you know why it is broken I maybe can figuren out if it has to do something with DS

karimiehsan1819’s picture

i also got this error Notice: Undefined index: ds_layouts in _ds_field_ui_table_layouts_preview() (line 1944 or 1943 ,why?

  • aspilicious committed 43848ed on 7.x-2.x
    Issue #2541786 by aspilicious: Changing layout to "fluid 2 columns...
aspilicious’s picture

Apparently I got some git issues.
My commits were stuck on my local machine.

Managed to push this for real now, triple checked the repo.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

themorebeautifulworld’s picture

I applied patch #8 to ds 7.x-2.11. This does fix the error I was seeing:

Notice: Undefined index: ds_layouts in _ds_field_ui_table_layouts_preview() (line 1940 of /var/www/html/quickedit/sites/all/modules/ds/includes/ds.field_ui.inc).

...However, I cannot successfully change to a selected layout. Just goes to a blank page. Nothing in the logs after patching.

The same happens when I uninstall and try with 7.x-2.x-dev. And no log messages, just a white page and no settings changes.

I also tried manually removing rows from ds_layout_settings. That seemed to work, insofar as I was able to select a layout. But then when I tried to assign fields to different regions, I could only get that same empty white page and the settings aren't taking effect. And this method doesn't work every time. I can delete the relevant rows, clear the site cache and try to save changes and it won't work. The same procedure worked minutes earlier. Now, it does nothing and I just get the white screen. So I look at the database and sure enough, ds_layout_settings still has 0 rows.

What can I try next?

themorebeautifulworld’s picture

Status: Closed (fixed) » Active
aspilicious’s picture

There is also a ds_field_settings table. If you do stuff manually you need to take care of that table as well.

themorebeautifulworld’s picture

I've had 0 rows in ds_field_settings from the start.

ds_fields and ds_view_modes also 0 rows.