Update content visibility code to work with version 11.6.x

Created on 2 February 2023, over 1 year ago
Updated 19 May 2023, over 1 year ago

Problem/Motivation

Code for changing the group content visibility options of custom groups needs to be updated to work with Open Social 11.6.x.

Errors when trying to change group content visibility:

Error: Class "Drupal\social_group_types\SocialFlexContentVisibilityUpdate" not found in _social_group_types_edit_submit() (line 515 of modules/contrib/social_group_types/social_group_types.module).

TypeError: Drupal\social_group_types\SocialGroupTypesContentVisibilityUpdate::batchUpdateGroupContentVisibility(): Argument #1 ($group) must be of type Drupal\social_group_types\GroupInterface, Drupal\social_group\Entity\Group given, called in /app/html/modules/contrib/social_group_types/social_group_types.module on line 516 in Drupal\social_group_types\SocialGroupTypesContentVisibilityUpdate::batchUpdateGroupContentVisibility() (line 34 of modules/contrib/social_group_types/src/SocialGroupTypesContentVisibilityUpdate.php).

An error occurred while processing \Drupal\social_group_types\SocialGroupTypesContentVisibilityUpdate::updateVisibility with arguments : \Drupal\social_group_types\SocialGroupTypesContentVisibilityUpdate::updateVisibility

Steps to reproduce

Change group content visibility options on a custom group and save. You get a WSOD.

Proposed resolution

An issue fork with many changes to update to version 11.6.x of Open Social in social_group_types.module and src/SocialGroupTypesContentVisibilityUpdate.php files is proposed to be merged.

After appying the changes group content visibility options are saved without errors and batch operations run correctly.

Tested on:
Open Social: 11.6.3
Drupal Version: 9.4.10
PHP: 8.0.10

Remaining tasks

Review changes and test with latest versions of Open Social to check if anything needs to be updated.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024