Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrade to Grav 1.1.8: "E_WARNING - Illegal string offset 'scheme'" on [plugin:content-inject] #8

Closed
beijersb opened this issue Oct 28, 2016 · 4 comments

Comments

@beijersb
Copy link

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).

@rhukster
Copy link
Member

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)

@crusnac
Copy link

crusnac commented Dec 8, 2017

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} [] []

@crusnac
Copy link

crusnac commented Dec 8, 2017

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.

@rhukster rhukster self-assigned this Dec 8, 2017
@rhukster rhukster added bug and removed question labels Dec 8, 2017
@rhukster
Copy link
Member

rhukster commented Dec 8, 2017

This should fix it!

getgrav/grav@6628bbb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants