Closed (cannot reproduce)
Project:
Organic Groups Menu (OG Menu)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2018 at 08:47 UTC
Updated:
26 Mar 2020 at 13:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
fernly commentedComment #3
fernly commentedog_audience field only exists as of the creation of the first ogmenu_instance. As long as there is no data for ogmenu_instance, the fatal error will occur on deletion of an OG group.
This patch should fix this.
Comment #4
fernly commentedComment #5
ducktape commentedI think it would be better to check if the og_audience field exists, but this works for the described behavior.
Comment #6
fernly commentedTrue, not all cases would be covered. I added a new patch that catches the error and simply ignores it because it's not relevant in this case.
Comment #7
fernly commentedPlaced the use statement in the right spot.
Should be ready to commit.
Comment #8
pfrenssenI'm not sure if this is the right approach. An `EntityStorageException` might also be thrown while deleting one of the menu instances, in which case this will be silently ignored and all following instances will remain orphaned.
Also from the issue summary it is suggested that the exception is thrown when "og_menu_entity_delete() searches for ogmenu instances by the property og_audience" so I am guessing this happens in the
$storage->loadByProperties()call, but this method is not supposed to throw any exceptions. It should return an empty result.Can you provide a backtrace or a failing test to get more insight in what is exactly going wrong?
Comment #9
mpp commentedIn the past this could be reproduced as:
- set delete_orphans to FALSE
- create a group
- delete its ogmenu_instance
- delete the group
But I can no longer reproduce this.
Comment #10
mpp commented@Fernly, try setting delete_orphans in og.settings to TRUE.
I can only guess that there was a bug in core in loadByProperties() that is now fixed.