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

Using simplesearch @self route for a collection page throws error #80

Closed
fredrikekelund opened this issue Nov 10, 2016 · 2 comments
Closed

Comments

@fredrikekelund
Copy link

fredrikekelund commented Nov 10, 2016

I don't know what details you might need to reproduce this, but basically what I'm trying to do is to add a simplesearch configuration to a collection page, to be able to query its children. I'm using this page frontmatter:

---
title: Projects
simplesearch:
    route: @self
    filter_combinator: and
    filters:
        - @self
content:
    items: '@self.children'
---

And I'm getting this exception:

Whoops\Exception\ErrorException thrown with message "Indirect modification of overloaded property Grav\Common\Data\Data::$route has no effect"

Stacktrace:
#15 Whoops\Exception\ErrorException in /vagrant/grav-admin/vendor/rockettheme/toolbox/ArrayTraits/src/NestedArrayAccess.php:64
#14 Whoops\Run:handleError in /vagrant/grav-admin/vendor/rockettheme/toolbox/ArrayTraits/src/NestedArrayAccess.php:64
#13 Grav\Common\Data\Data:set in /vagrant/grav-admin/user/plugins/simplesearch/simplesearch.php:103
#12 Grav\Plugin\SimplesearchPlugin:onPagesInitialized in /vagrant/grav-admin/vendor/symfony/event-dispatcher/EventDispatcher.php:184
#11 call_user_func in /vagrant/grav-admin/vendor/symfony/event-dispatcher/EventDispatcher.php:184
#10 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in /vagrant/grav-admin/vendor/symfony/event-dispatcher/EventDispatcher.php:46
#9 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /vagrant/grav-admin/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php:23
#8 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in /vagrant/grav-admin/system/src/Grav/Common/Grav.php:272
#7 Grav\Common\Grav:fireEvent in /vagrant/grav-admin/system/src/Grav/Common/Processors/PagesProcessor.php:25
#6 Grav\Common\Processors\PagesProcessor:process in /vagrant/grav-admin/system/src/Grav/Common/Grav.php:121
#5 Grav\Common\Grav:Grav\Common\{closure} in /vagrant/grav-admin/system/src/Grav/Common/Grav.php:358
#4 Grav\Common\Grav:Grav\Common\{closure} in /vagrant/grav-admin/system/src/Grav/Common/Grav.php:334
#3 call_user_func_array in /vagrant/grav-admin/system/src/Grav/Common/Grav.php:334
#2 Grav\Common\Grav:__call in /vagrant/grav-admin/system/src/Grav/Common/Grav.php:122
#1 Grav\Common\Grav:measureTime in /vagrant/grav-admin/system/src/Grav/Common/Grav.php:122
#0 Grav\Common\Grav:process in /vagrant/grav-admin/index.php:45

But if I change the route property on row 3 to read route: /projects (which is the actual URL of the page itself), it works fine.

I'm using the latest version of simplesearch, with the default configuration.

@A----
Copy link

A---- commented Dec 2, 2016

I have the same exception on php 5.5.25. Cannot reproduce it on 5.6 though.

@flaviocopes
Copy link
Contributor

@fredrikekelund @A---- should be fixed by 2bf8c62 if you can test it

flaviocopes added a commit that referenced this issue Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants