giansi/gravstrap

gravstrap breaks entire grav install??

Closed this issue · 3 comments

getgrav/grav-plugin-admin#487

I will copy it here:

It seems like it is gravstrap plugin, but I could be wrong. I don't remember changing anything that caused this break, but is it possible that I deleted a line or something and accidentally broke something. Anyway, the error message is:

Whoops\Exception\ErrorException thrown with message "Argument 1 passed to Grav\Plugin\ShortcodeManager::getId() must implement interface Thunder\Shortcode\Shortcode\ShortcodeInterface, null given, called in
C:\wamp\www\grav\user\plugins\gravstrap\classes\Base\GravstrapShortcode.php on line 204 and defined"

Stacktrace:
#27 Whoops\Exception\ErrorException in C:\wamp\www\grav\user\plugins\shortcode-core\classes\ShortcodeManager.php:264
#26 Whoops\Run:handleError in C:\wamp\www\grav\user\plugins\shortcode-core\classes\ShortcodeManager.php:264
#25 Grav\Plugin\ShortcodeManager:getId in C:\wamp\www\grav\user\plugins\gravstrap\classes\Base\GravstrapShortcode.php:204
#24 Grav\Plugin\Shortcodes\GravstrapShortcode:registerOutput in C:\wamp\www\grav\user\plugins\gravstrap\shortcodes\Basic\GravstrapSectionShortcode.php:67
#23 Grav\Plugin\Shortcodes\GravstrapSectionShortcode:renderOutput in C:\wamp\www\grav\user\plugins\gravstrap\classes\Base\GravstrapShortcode.php:65
#22 Grav\Plugin\Shortcodes\GravstrapShortcode:Grav\Plugin\Shortcodes\{closure} in C:\wamp\www\grav\user\plugins\shortcode-core\vendor\thunderer\shortcode\src\Processor\Processor.php:134
#21 call_user_func_array in C:\wamp\www\grav\user\plugins\shortcode-core\vendor\thunderer\shortcode\src\Processor\Processor.php:134
#20 Thunder\Shortcode\Processor\Processor:processHandler in C:\wamp\www\grav\user\plugins\shortcode-core\vendor\thunderer\shortcode\src\Processor\Processor.php:93
#19 Thunder\Shortcode\Processor\Processor:processIteration in C:\wamp\www\grav\user\plugins\shortcode-core\vendor\thunderer\shortcode\src\Processor\Processor.php:53
#18 Thunder\Shortcode\Processor\Processor:process in C:\wamp\www\grav\user\plugins\shortcode-core\classes\ShortcodeManager.php:228
#17 Grav\Plugin\ShortcodeManager:processContent in C:\wamp\www\grav\user\plugins\shortcode-core\shortcode-core.php:90
#16 Grav\Plugin\ShortcodeCorePlugin:onPageContentProcessed in C:\wamp\www\grav\vendor\symfony\event-dispatcher\EventDispatcher.php:181
#15 call_user_func in C:\wamp\www\grav\vendor\symfony\event-dispatcher\EventDispatcher.php:181
#14 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in C:\wamp\www\grav\vendor\symfony\event-dispatcher\EventDispatcher.php:46
#13 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in C:\wamp\www\grav\vendor\rockettheme\toolbox\Event\src\EventDispatcher.php:23
#12 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:449
#11 Grav\Common\Grav:fireEvent in C:\wamp\www\grav\system\src\Grav\Common\Page\Page.php:561
#10 Grav\Common\Page\Page:content in C:\wamp\www\grav\user\plugins\gravstrap\gravstrap.php:89
#9 Grav\Plugin\GravstrapPlugin:onTwigSiteVariables in C:\wamp\www\grav\vendor\symfony\event-dispatcher\EventDispatcher.php:181
#8 call_user_func in C:\wamp\www\grav\vendor\symfony\event-dispatcher\EventDispatcher.php:181
#7 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in C:\wamp\www\grav\vendor\symfony\event-dispatcher\EventDispatcher.php:46
#6 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in C:\wamp\www\grav\vendor\rockettheme\toolbox\Event\src\EventDispatcher.php:23
#5 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:449
#4 Grav\Common\Grav:fireEvent in C:\wamp\www\grav\system\src\Grav\Common\Twig\Twig.php:310
#3 Grav\Common\Twig\Twig:processSite in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:186
#2 Grav\Common\Grav:Grav\Common\{closure} in C:\wamp\www\grav\vendor\pimple\pimple\src\Pimple\Container.php:113
#1 Pimple\Container:offsetGet in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:288
#0 Grav\Common\Grav:process in C:\wamp\www\grav\index.php:38

All grav pages in this install are giving me this error in web browser
I think it is odd that the admin plugin got the same error (admin should work if all else fails unless the php server itself is down). So that implies that one plugin (not the admin plugin) had the ability to break the functions of other plugins with pages that have nothing to do with that plugin.

https://www.dropbox.com/s/mp29bf042o24ypb/gravstrap%20plugin%20bad.zip?dl=1

Let me know if you need more files. I can zip/upload the entire grav install if needed to help reproduce the problem.
Github has issues with their uploader and zip files.

I was able to install a fresh copy of grav and gravstrap and everything went back to normal. I was using 1.0.5 up to date version of gravstrap. But it is still a bug that needs fixing. Unfortunately I did not back up the entire old installation.

But Like @rhukster said getgrav/grav-plugin-shortcode-core#14 (comment)

Well I don't know. I do know that the Gravstrap plugin is sending a null to the getId() method of ShortcodeCore, and that is throwing the error.

The problem lies in the GravStrap plugin, and as I didn't write that plugin i'm going to hand off responsibility to the author of it. I suggest you take this up with @giansi on the issue you created [here]

Yes, would be awesome to get it solved, but I'm too new to Grav to help

1.2.0 should have fixed