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

Calling Craft::$app->urlManager->getMatchedElement() in plugin results in 404 #401

Closed
davist11 opened this issue Jun 26, 2018 · 2 comments
Closed
Labels
ℹ️ status: need more info When waiting for user to supply database or more information.

Comments

@davist11
Copy link
Contributor

Description

We have a plugin that is checking to see if the element is available in other languages, so we are calling

$element = Craft::$app->urlManager->getMatchedElement();

Anytime I visit a product element url, I get a 404 error. Other element types appear to work fine.

Steps to reproduce

  1. Create a plugin and drop $element = Craft::$app->urlManager->getMatchedElement(); into the init() method
  2. Visit a product element url

Additional info

  • Craft version: Craft Pro 3.0.11
  • PHP version: 7.1.12
  • Database driver & version: MySQL 5.6.38
  • Plugins & versions:
Algolia 1.0.0
Amazon S3 1.0.8
Asset Rev 6.0.0
AsyncQueue 1.3.2
Audit 2.0.1
Automatic Site Switch 1.0.0
Calendar 2.0.3
Category Utilities 1.0.0
Certificates 1.0.0
Converge 1.0.0
Craft Commerce dev-master
Environment Label 3.1.4
Feed Me 3.0.0-beta.15
Field Manager 2.0.2
Flat Categories 2.0.0
Forms 2.0.4
Freeform Pro 2.0.4
Geo Cookie 1.1.2
Hamilton Utility 1.0.0
Importer 1.0.0
Inlin 2.0.0
Inventory 1.0.0
Locale Redirector 1.0.0
OrderExporter 1.0.0
Redactor 2.1.0
Sidebar Toggle 2.0.0
SimpleSentry 1.0.0
Super Table 2.0.7
Taxes 1.0.0
Twig Perversion 2.0.3
@davist11
Copy link
Contributor Author

Looks like this actually may be related to craftcms/cms#3028

@lukeholder lukeholder added the ℹ️ status: need more info When waiting for user to supply database or more information. label Jul 10, 2018
@lukeholder
Copy link
Member

Let us know if the issue persists and we can look to reopen,.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ℹ️ status: need more info When waiting for user to supply database or more information.
Projects
None yet
Development

No branches or pull requests

2 participants