TypeError in social_group_secret.module

Created on 17 January 2023, almost 2 years ago
Updated 6 December 2023, 12 months ago

This may not be a bug in Open Social, it may be a different issue with my particular installation, but I'm sharing this patch in case it helps anybody else.

Problem/Motivation

When attempting to edit a secret group, some users are reporting this error:

TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in array_keys() (line 35 of profiles/contrib/social/modules/social_features/social_group/modules/social_group_secret/social_group_secret.module).

Proposed resolution

Check value exists before using.

🐛 Bug report
Status

Needs review

Version

11.5

Component

Code (back-end)

Created by

🇬🇧United Kingdom RhiP

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.

  • 🇳🇱Netherlands Yuri

    My installation also has this issue,
    Using social-11.7.1

    It relates to the group select widget type in the node edit form.
    It throws this error when using:
    - Autocomplete
    - Autocomplete tags style
    - Categorized checkboxes/radio buttons

    The error does not show when using:
    - Social group select list
    - Select2
    - Select list

    p.s. your patch in #2 did not work for me.

  • Status changed to Needs review 12 months ago
  • 🇨🇦Canada drclaw

    Updating patch using empty() since in some (if not all cases) the error is because the element is actually missing entirely.

Production build 0.71.5 2024