Problem/Motivation
BlockPluginInterface defines build() method that is supposed to return an array.
However, AggregatorFeedBlock returns NULL when configured feed is not loaded.
Proposed resolution
Return empty array when feed cannot be loaded.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3212354-10.patch | 2.49 KB | guilhermevp |
Comments
Comment #2
chi commentedComment #3
guilhermevp commentedA patch for it.
Comment #4
chi commentedThe patch includes a bunch of unrelated changes.
Comment #5
guilhermevp commentedSorry for wrong patch.
Comment #6
chi commented@guilhermevp I would use early return instead of "else".
Example: https://git.drupalcode.org/project/drupal/-/blob/9.1.8/core/modules/help...
Comment #7
guilhermevp commentedRight, makes sense. Thanks for the feedback!
Comment #8
chi commented@guilhermevp That's not early return but rather the opposite.
https://pear.php.net/manual/en/standards.bestpractices.php#standards.bes...
Comment #9
guilhermevp commentedSorry, thanks again for the feedback.
Sending patch.
Comment #10
guilhermevp commentedremoved indentation error.
Comment #11
chi commentedThank you.
Comment #15
catchDon't think it's useful to add an explicit test for this.
Committed/pushed to 9.3.x, cherry-picked to 9.2.x and 9.1.x, thanks!