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.
Problem/Motivation
Opigno Learning Path rewrites Group's views.view.group_members.yml
view and adds the group membership status view field handler. However the latter assumes it is always dealing with a learning path row, which might not actually be the case, as this view is used by any group type. Specifically, if the group is not a LP, its memberships may have no status, which triggers the following notice:
Notice: Undefined offset: 0 in Drupal\opigno_learning_path\LearningPathAccess::getMembershipStatus() (line 193 of modules/contrib/opigno_learning_path/src/LearningPathAccess.php).
Proposed resolution
Check the row bundle before running LP-specific logic.
Remaining tasks
- Validate the proposed solution
Write a patch- Reviews
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
None
Comment | File | Size | Author |
---|---|---|---|
#5 | opigno_learning_path-3061245-4.patch | 676 bytes | catch |
#2 | opigno_learning_path-status_view_field-3061245-2.patch | 659 bytes | plach |
Comments
Comment #2
plachComment #3
axelmHi
The patch will be applied to the next release of Opigno
Comment #4
axelmComment #5
catchUnfortunately there's a mistake in the patch. The entity being checked is the group membership, so the bundle check should be 'learning_path-group_memberhip'.
Comment #6
plachLooks good to me, thanks!
Comment #7
axelmComment #8
axelmComment #9
axelm