Check for empty col_config and col_content

Created on 23 July 2021, over 3 years ago
Updated 4 June 2024, 7 months ago

Problem/Motivation

I'm seeing the following errors in logs and on local in the on-screen error messages.

Warning: reset() expects parameter 1 to be array, null given in template_preprocess_we_megamenu_row() (line 480 of modules/contrib/we_megamenu/we_megamenu.module).
Notice: Undefined property: stdClass::$col_config in template_preprocess_we_megamenu_col() (line 509 of modules/contrib/we_megamenu/we_megamenu.module).
Notice: Trying to get property 'width' of non-object in template_preprocess_we_megamenu_col() (line 536 of modules/contrib/we_megamenu/we_megamenu.module).
Notice: Trying to get property 'width' of non-object in template_preprocess_we_megamenu_col() (line 539 of modules/contrib/we_megamenu/we_megamenu.module).

Steps to reproduce

Unsure how to reproduce, or what caused this all of a sudden, but I have a patch in case anyone else needs it.

Proposed resolution

Improve checking for empty values.

Remaining tasks

  1. Patch
  2. Review

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇪🇨Ecuador jwilson3

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.

Production build 0.71.5 2024