Structures
Structures copied to clipboard
Sanity check for the plugin
Line 47 of the Structures plugin has this:
if($resourceTemplateId = $resource->get("template")){
This crashes the Manager completely if $resource isn't set. It's probably rare, but it's happening to me in some code I'm trying to use to forward users to the Create/Edit Resource panel for a specific resource.
I changed it to this as a temporary fix, but I'm not sure what should happen if $resource is not set.
if($resource && ($resourceTemplateId = $resource->get("template"))){