Ticket #1499 (new defect)
Call to Member() on non-object on MemberTableField.php
| Reported by: | sharvey | Owned by: | aoneil |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | Modules - newsletter | Version: | |
| Severity: | medium effort / impact | Keywords: | |
| Cc: | Hours: |
Description
Animfx had a problem with the newsletter system, there was a non-object error when you clicked a few times on some draft newsletters, then refreshed the page admin/newsletter.
It was a strange bug, and only occured on the live site.
The fix was to add some extra checks on line 359 of MemberTableField?.php
if($this->group && $this->group->Members()) {
}
This IF block wraps around the whole sourceItems = $this->group->Members() so that it can't reach a non-object (and causing the whole system to fail).
Please ensure this fix is added to the latest branch of SS. If you find there's a better solution, please do that, but this one seems to work fine because there's situations when $this->group doesn't exist on sourceItems()
