Closed beijersb closed 5 years ago
That's strange. I just tested with latest and my content-inject tests work just fine. I have the following syntax:
This is a test of Page Inject plugin:
[plugin:content-inject](/media)
[plugin:page-inject](/test/modular/_callout)
[plugin:page-inject](/test/parsedown?template=page-inject)
I am getting the same thing after I upgrade to 1.3.10. I am getting the following error: Server Error Sorry, something went terribly wrong!
E_WARNING - Illegal string offset 'scheme'
For further details please review your logs/ folder, or enable displaying of errors in your system configuration.
See the log:
[2017-12-08 18:16:16] grav.CRITICAL: Illegal string offset 'scheme' - Trace: #0 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Uri.php(946): Whoops\Run->handleError(2, 'Illegal string ...', '/Users/crusna/D...', 946, Array) #1 /Users/crusna/Documents/Web/prod/nike/nisp-cms/user/plugins/page-inject/page-inject.php(83): Grav\Common\Uri::convertUrl(Object(Grav\Common\Page\Page), '/introduction/t...') #2 [internal function]: Grav\Plugin\PageInjectPlugin->Grav\Plugin\{closure}(Array) #3 /Users/crusna/Documents/Web/prod/nike/nisp-cms/user/plugins/page-inject/page-inject.php(120): preg_replace_callback('/\\[plugin:(cont...', Object(Closure), 'This comprehens...') #4 /Users/crusna/Documents/Web/prod/nike/nisp-cms/user/plugins/page-inject/page-inject.php(113): Grav\Plugin\PageInjectPlugin->parseInjectLinks('This comprehens...', Object(Closure)) #5 [internal function]: Grav\Plugin\PageInjectPlugin->onPageContentRaw(Object(RocketTheme\Toolbox\Event\Event), 'onPageContentRa...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) #6 /Users/crusna/Documents/Web/prod/nike/nisp-cms/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(RocketTheme\Toolbox\Event\Event), 'onPageContentRa...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) #7 /Users/crusna/Documents/Web/prod/nike/nisp-cms/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'onPageContentRa...', Object(RocketTheme\Toolbox\Event\Event)) #8 /Users/crusna/Documents/Web/prod/nike/nisp-cms/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php(23): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('onPageContentRa...', Object(RocketTheme\Toolbox\Event\Event)) #9 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Grav.php(288): RocketTheme\Toolbox\Event\EventDispatcher->dispatch('onPageContentRa...', Object(RocketTheme\Toolbox\Event\Event)) #10 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Page/Page.php(649): Grav\Common\Grav->fireEvent('onPageContentRa...', Object(RocketTheme\Toolbox\Event\Event)) #11 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Twig/Twig.php(327): Grav\Common\Page\Page->content() #12 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Service/OutputServiceProvider.php(27): Grav\Common\Twig\Twig->processSite('html') #13 /Users/crusna/Documents/Web/prod/nike/nisp-cms/vendor/pimple/pimple/src/Pimple/Container.php(118): Grav\Common\Service\OutputServiceProvider->Grav\Common\Service\{closure}(Object(Grav\Common\Grav)) #14 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Processors/RenderProcessor.php(19): Pimple\Container->offsetGet('output') #15 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Grav.php(132): Grav\Common\Processors\RenderProcessor->process() #16 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Grav.php(379): Grav\Common\Grav->Grav\Common\{closure}() #17 [internal function]: Grav\Common\Grav::Grav\Common\{closure}('render', 'Render', Object(Closure)) #18 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Grav.php(355): call_user_func_array(Object(Closure), Array) #19 /Users/crusna/Documents/Web/prod/nike/nisp-cms/system/src/Grav/Common/Grav.php(133): Grav\Common\Grav->__call('measureTime', Array) #20 /Users/crusna/Documents/Web/prod/nike/nisp-cms/index.php(52): Grav\Common\Grav->process() #21 {main} [] []
The problem has to do with if absolute paths are enabled. If you set absolute_urls: true
in the system.yaml file, it will break the page inject plugin.
This should fix it!
https://github.com/getgrav/grav/commit/6628bbbe2fff8b1506bb1eade13970520217df35
I just upgraded tot Grav 1.1.8 and the [plugin:content-inject]() stopped working with an error: E_WARNING - Illegal string offset 'scheme'
The relevant log line: in attachment log.txt
I have not investigated it further (yet).