dynamic / silverstripe-elemental-blog

Display a list of the most recent posts of a specific blog
BSD 3-Clause "New" or "Revised" License
1 stars 10 forks source link

BUGFIX Call to a member function Categories() on null #39

Closed muskie9 closed 2 years ago

muskie9 commented 2 years ago

Resolves an issue where no blog selected causes a chained Categories() relation call to error when attempting to edit the block later in the cms.

I haven't been able to build a proper test case that demonstrates the fix, however in local testing the cms now loads if no Blog is selected on an existing block.

resolves #38

codecov[bot] commented 2 years ago

Codecov Report

Merging #39 (c1ad497) into 2.1 (2f3a0a5) will decrease coverage by 3.28%. The diff coverage is 66.66%.

:exclamation: Current head c1ad497 differs from pull request most recent head 29e80eb. Consider uploading reports for the commit 29e80eb to get more accurate results

@@             Coverage Diff              @@
##                2.1      #39      +/-   ##
============================================
- Coverage     85.10%   81.81%   -3.29%     
+ Complexity       14       13       -1     
============================================
  Files             1        1              
  Lines            47       44       -3     
============================================
- Hits             40       36       -4     
- Misses            7        8       +1     
Flag Coverage Δ
php ?
unittests 81.81% <66.66%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Elements/ElementBlogPosts.php 81.81% <66.66%> (-3.29%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.