Closed (fixed)
Project:
Election
Version:
7.x-1.x-dev
Component:
election_post
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Nov 2015 at 21:27 UTC
Updated:
27 Dec 2015 at 00:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
liam morlandComment #3
pjcdawkins commentedI'd be reluctant to hide this notice. As posts are deleted when their elections are deleted (through election_post_entity_delete()), it should be impossible that this happens. So the notice reveals another bug, perhaps.
Comment #4
liam morlandCould be. I just saw the notice when I deleted an election.
Comment #5
liam morlandI notice that election_post_entity_load() calls election_load_multiple(), which calls entity_load(). Would that not loop back and trigger hook_entity_load() again? That would explain why I get the error message multiple times with the same number as the undefined index every time it happens.
Comment #6
liam morlandSteps to reproduce:
An election without any positions does not cause this error.
The undefined index is the election_id of the deleted election.
Comment #7
liam morlandComment #8
pjcdawkins commentedOK, thanks for the update - committed
Comment #10
liam morlandI'm a bit concerned that my fix may not be the right thing; I don't understand the code well enough to know. As I suggested in #5, the code could be, in effect, calling itself. That is probably not what should happen. But you know the code better than I do, so I trust you judgement.
Comment #11
pjcdawkins commentedYes, but that's OK - it would trigger hook_entity_load() for the 'election' entity type, not 'election_post'. The hook has the entity type as the second parameter.