I always get this warning:

Notice: Undefined index: layout_attributes_merge in ds_entity_variables() (line 962 of /sites/all/modules/ds/ds.module).

I don't know what's causing it or where to look at.

Comments

swentel’s picture

Status: Active » Closed (works as designed)

That's since #1605212: Template attributes missing from Display Suite layouts - head to head upgrades don't exists. Resaving layouts will make the error go away

okeedoak’s picture

Status: Closed (works as designed) » Active

What's the best way to resave the layouts? I've tried changing the layout in Manage Display, "Layout for [content-type] in teaser" then saving with no effect. I've tried changing the layout in the default view mode, resaving and again the error is shown. Any advice?

okeedoak’s picture

Status: Active » Closed (works as designed)

Never mind, I just uninstalled and reinstalled. That did the trick.

tanitani’s picture

Unfortunately the uninstall re-install is not feasible in cases like mine where large amount of customization would be lost.

I installed the ds 7.x-2.x-dev version from June 1st in a test environment. I wanted resolve an issue described in EntityMalformedException: Missing bundle property on entity of type taxonomy_term. (unsuccessfully, unfortunately).

Therefore, the question will be how to update the module and avoid this issue when you are ready to release it.

Thank you swentel for your work. Much appreciated.
Gábor

Wolfgang Reszel’s picture

In my case this error reoccurs sometimes and I tried to resave and dis-/reenabled the module.

tanitani’s picture

Wolfgang, would that not affect the existing customization?

Wolfgang Reszel’s picture

No, only when uninstalling the module. Just disabling a module will not delete its database entry.

dale386’s picture

Does anyone have a fix for this? I've tried disabling/re-enabling with no success. I don't want to uninstall the module for fear of losing my settings.

dale386’s picture

Status: Closed (works as designed) » Active
swentel’s picture

Status: Active » Closed (works as designed)

Just resave the layouts, see the comment in #1.

swentel’s picture

Status: Closed (works as designed) » Closed (duplicate)

Woops, no, see #1605212: Template attributes missing from Display Suite layouts - this due to a bad commit, there's a patch there, but haven't tested it yet.

wormz30’s picture

I think I have a fix for it...

For me, it was on line 963.

    if ($layout['settings']['layout_attributes_merge']) {
      $vars['layout_attributes'] .= ' ' . drupal_attributes($vars['attributes_array']);
    }

I changed the conditional statement to include an "isset()" because that's what i usually do when a variable hasn't been defined where in this case layout_attributes_merge had never been defined at all prior to this statement. So, my code looks like this:

    if (isset($layout['settings']['layout_attributes_merge'])) {
      $vars['layout_attributes'] .= ' ' . drupal_attributes($vars['attributes_array']);
    }

It worked for me!

ericinwisconsin’s picture

Worked for me too, wormz30. Thank you!

SandraVdv’s picture

Status: Closed (duplicate) » Active
StatusFileSize
new630 bytes

http://drupal.org/node/1605212 isn't the fix for this problem, the patch in that issue is already included in the 7.x-2.x-dev?
The fix in #12 worked for me. I attached a patch for this.

swentel’s picture

Status: Active » Postponed (maintainer needs more info)

Just wondering, if you resave the layout where you have the notice (without the patch), doesn't the notice go away, because in includes/ds.field_ui.inc we're adding a key to the settings. However, since this is fairly new, people who upgraded between dev releases and have layouts configured already will get the notice. And dev to dev upgrades aren't supported (7.x-1.x to 7.x-2.x is another question, but a really hard one). The isset should be fine once the layout is saved.

kclarkson’s picture

Status: Postponed (maintainer needs more info) » Needs review

I am having the same error and did a little trouble shooting. Again I am upgrading from the 7.x-1.x version and understand there are some issues.

1. I deleted all of my custom layouts and changed all my views that were using them.
2 I was still receiving errors on pages that were using the "teaser" view. I noticed that my "teaser" view custom layout was managed by display suite.
3. Went to my node displays and unchecked the "teaser" box for custom display settings. And hit "SAVE". The error then went away.
4. Went back and added Custom Display View Modes and no errors.

So what Swentel is saying is correct, in that you must RE-SAVE all content types that were using DS for layout regardless of whether it was a custom display view mode or the basic view modes (teaser, full content, rss ect..)

Someone else give this a try upgrading from 7.x-1.x and let me know if it works. If so this may need to go into the upgrade documentation.

kclarkson’s picture

While resaving fixed my issue on my local computer, when I uploaded to "Pantheon", the errors came back.

I even applied the patch above. It said whitespace errors. Here is the final error.

Notice: Undefined index: layout_attributes_merge in ds_entity_variables() (line 963 of /srv/bindings/65a0c28946f64375a11a841bf09ab1d5/code/sites/all/modules/contrib/ds/ds.module).

kclarkson’s picture

Okay sorry to be a psycho but I tried one last thing.

Before I was just resaving my layouts by turning it off and on. If you actually move a field then save it SWENTEL, is correct once again !! The errors go away. I am assuming something needs to change for the isset actually changes.

kingfisher64’s picture

Patch on #14 worked for me.

swentel’s picture

Status: Needs review » Closed (fixed)

Closing. Again, if you upgrade from 7.x-1.x (which is not the intention on an existing site), you need to resave all layouts.

zak_umich’s picture

I just opened whatever page I used a layout example: article display then pressed save.

Do this to all the forms/pages you used layouts and it goes away.

I think that's what Swentel meant

Ole Martin’s picture

When I use#12, I get "500 Server error" ?

Ole Martin’s picture

Issue summary: View changes

typo