Closed timkelty closed 7 years ago
What PHP version were you on?
7.0.13
Weird, and of course now I can't reproduce the error.
I thought that way of using use() was only necessary in PHP 5.3 to make things accessible inside the scope of the anonymous function. No problem merging in the PR, as PHP 5.3 compatibility is a plus, just curious if there was something I'd missed. :)
That's right - and we're in an anonymous function (2nd arg of craft()->on
) and need access to the outside scope's $purgeRelated
.
/index.php?p=cp/actions/elements/saveElement
<h1>PHP Error [500]</h1>
<p>Undefined variable: purgeRelated (/Users/timkelty/Sites/paddling/craft/plugins/varnishpurge/VarnishpurgePlugin.php:78)</p>
<pre>#0 /Users/timkelty/Sites/paddling/craft/app/etc/errors/ErrorHandler.php(184): Craft\ErrorHandler->handleError()
#1 /Users/timkelty/Sites/paddling/craft/app/framework/base/CErrorHandler.php(133): Craft\ErrorHandler->handleError()
#2 /Users/timkelty/Sites/paddling/craft/app/framework/base/CApplication.php(834): Craft\ErrorHandler->handle()
#3 /Users/timkelty/Sites/paddling/craft/app/etc/web/WebApp.php(687): Craft\WebApp->handleError()
#4 /Users/timkelty/Sites/paddling/craft/plugins/varnishpurge/VarnishpurgePlugin.php(78): Craft\WebApp->handleError()
#5 /Users/timkelty/Sites/paddling/craft/app/framework/base/CComponent.php(567): Craft\VarnishpurgePlugin->Craft\{closure}()
#6 /Users/timkelty/Sites/paddling/craft/app/services/ElementsService.php(2379): Craft\ElementsService->raiseEvent()
#7 /Users/timkelty/Sites/paddling/craft/app/services/ElementsService.php(1657): Craft\ElementsService->onSaveElement()
#8 /Users/timkelty/Sites/paddling/craft/app/elementtypes/BaseElementType.php(656): Craft\ElementsService->saveElement()
#9 /Users/timkelty/Sites/paddling/craft/app/elementtypes/AssetElementType.php(555): Craft\AssetElementType->saveElement()
#10 /Users/timkelty/Sites/paddling/craft/app/controllers/ElementsController.php(114): Craft\AssetElementType->saveElement()
#11 /Users/timkelty/Sites/paddling/craft/app/framework/web/actions/CInlineAction.php(49): Craft\ElementsController->actionSaveElement()
#12 /Users/timkelty/Sites/paddling/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams()
#13 /Users/timkelty/Sites/paddling/craft/app/framework/web/CController.php(286): Craft\ElementsController->runAction()
#14 /Users/timkelty/Sites/paddling/craft/app/framework/web/CController.php(265): Craft\ElementsController->runActionWithFilters()
#15 /Users/timkelty/Sites/paddling/craft/app/framework/web/CWebApplication.php(282): Craft\ElementsController->run()
#16 /Users/timkelty/Sites/paddling/craft/app/etc/web/WebApp.php(817): Craft\WebApp->runController()
#17 /Users/timkelty/Sites/paddling/craft/app/etc/web/WebApp.php(287): Craft\WebApp->_processActionRequest()
#18 /Users/timkelty/Sites/paddling/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#19 /Users/timkelty/Sites/paddling/craft/app/index.php(62): Craft\WebApp->run()
#20 /Users/timkelty/Sites/paddling/public/index.php(18): require_once()
</pre>
As far as I can tell
master
is totally broken without this...