Problem/Motivation
If you have no page headers to modify then there is the following warning displayed:
Warning: foreach() argument must be of type array|object, null given in Drupal\access_unpublished\Form\SettingsForm->prepareHeadersDisplay()
Proposed resolution
Cast $headers as array to ensure warning is not shown.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | access_unpublished-n3409084-4.patch | 547 bytes | damienmckenna |
| #2 | 3409084.txt | 417 bytes | kristiantosney |
Comments
Comment #2
kristiantosney commentedComment #3
kristiantosney commentedComment #4
damienmckennaThank you for opening the issue and providing a patch.
Does this work? It skips the foreach() loop if the $headers list is empty.
Comment #6
generalredneckSimple fix. Pushed.