Problem/Motivation
Using an announcement type with no conditions breaks the announcement list page with the error Call to a member function getValue() on null in Drupal\announcements\AnnouncementListBuilder->buildRow()
Steps to reproduce
- Install the announcements module.
- Create an announcement of type Default.
- Visit /announcements.
Proposed resolution
Add null checks when attempting to load the visibility rules in AnnouncementListBuilder.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | announcements-without-conditions-3419856.patch | 737 bytes | jamosmk7 |
Issue fork announcements-3419856
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jamosmk7 commentedComment #3
jamosmk7 commentedComment #7
neclimdulExtended this fix to the access control class which has the same logic and ported the patch to a merge request.
Comment #9
richgerdesI like the solution here, but as a better idea, I think moving this to a function would make things clearer. I've updated the PR to provide helper functions for creating the plugins and validating the configs. This should make it more straight forward, and prevent issues in the future.
Comment #10
richgerdes