Structures icon indicating copy to clipboard operation
Structures copied to clipboard

Sanity check for the plugin

Open BobRay opened this issue 7 years ago • 0 comments

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"))){

BobRay avatar Sep 29 '18 21:09 BobRay