Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After upgrading from 2.40-rc1 to the last version 2.41 I get the following warnings:
Notice: Undefined property: stdClass::$field_oa_section in oa_toolbar_oa_space_menu_content_type_render() (line 85 of /var/www/html/profiles/openatrium/modules/apps/oa_toolbar/plugins/content_types/oa_space_menu.inc).
Notice: Undefined variable: icon in oa_toolbar_oa_space_menu_content_type_render() (line 114 of /var/www/html/profiles/openatrium/modules/apps/oa_toolbar/plugins/content_types/oa_space_menu.inc).
The problem only appears when I have the space menu enabled with a custom link to a node.
The problem disappears when I disable the custom link (About tab, see attached) and leave only document_section tabs.
Comment | File | Size | Author |
---|---|---|---|
#2 | fix-space-render-warnings-2486749-2.patch | 3.64 KB | nagy.balint |
SpaceMenuNotice.png | 39.64 KB | pgancarski |
Comments
Comment #1
hosais CreditAttribution: hosais commentedI have the same warning. To be more specific, in my site, when the space menu is enabled:
Has the warning:
When the content which is NOT section page and their parent is GROUP MENU (root and not section page).
NOT has the warning:
If the content is the child of section in the GROUP MENU, even it is enabled in menu link.
Comment #2
nagy.balint CreditAttribution: nagy.balint commentedI have the same issue, and this patch should fix the issue.
The issue happens because that menu also contains items that are not sections. And so in my case there was a space, and a ctools context, none of which had that field of course. So i put the issets in, and also the $icon variable should be initialized to empty before the if because otherwise it will be an undefined variable in those cases.
Apply the patch in oa_toolbar module in profiles/openatrium/modules/apps/oa_toolbar
Comment #3
mpotter CreditAttribution: mpotter commentedThanks for the patch! Committed to 79c0fda.