Skip to content
New issue

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

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

Already on GitHub? # to your account

Hooking in on Element Route triggers unsupported operand error #3128

Closed
bertoost opened this issue Jul 22, 2018 · 2 comments
Closed

Hooking in on Element Route triggers unsupported operand error #3128

bertoost opened this issue Jul 22, 2018 · 2 comments

Comments

@bertoost
Copy link
Contributor

Description

I followed this https://docs.craftcms.com/v3/extend/updating-plugins.html#getelementroute from the documentation to "infiltrate" on existing entry routes to custom control the page via a controller.
Did it before in Craft 2, that's why I came on this doc page.
Therefor I now handle this in a module instead of a plugin, but that shouldn't matter right?

Unfortunate this gives me the next error;

image

Additional info

  • Craft version: 3.0.16.1
  • PHP version: 7.1.17
  • Database driver & version: MySQL 5.7.20
@brandonkelly
Copy link
Member

Thanks for pointing that out! Fixed for the next release, but in the meantime you can change how your route is defined:

// from:
$event->route = 'products/view-entry';

// to:
$event->route = ['products/view-entry', []];

@bertoost
Copy link
Contributor Author

Cool! Thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants