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

404 not found for ngrest item edit #68

Closed
nadar opened this issue Mar 5, 2018 · 1 comment
Closed

404 not found for ngrest item edit #68

nadar opened this issue Mar 5, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@nadar
Copy link
Member

nadar commented Mar 5, 2018

Sometimes a 404 is thrown when clicking an ngrest item, example url:

admin/api-admin-user/1?ngrestCallType=update&fields=title%2Cfirstname%2Clastname%2Cemail

or

admin/api-admin-group/2?ngrestCallType=update&fields=name%2Ctext%2Cusers&expand=users

After cache reload, the 404 is gone.

Update: 14.3.2018

Problem introduced here: yiisoft/yii2#13425

Reproduce:

  1. clear application cache
  2. access the frontend - click on some pages
  3. log into admin and click on an edit page for a crud item

-> now the cache (even for the url manager) is created by the frontend, so the rules will not found in the admin anymore - as caching is already done.

Problem

The admin UrlRule is injected whether its admin request or not, but the content is empty (https://github.com/luyadev/luya/blob/master/core/web/Bootstrap.php#L84) so maybe the caching applies here already.

@nadar nadar self-assigned this Mar 5, 2018
@nadar
Copy link
Member Author

nadar commented Mar 8, 2018

How does LUYA provide the admin ngrest url rules:

  1. Bootstrap collects all apis from menu only when request is admin: https://github.com/luyadev/luya/blob/master/core/web/Bootstrap.php#L66
  2. Create the controller map array: https://github.com/luyadev/luya/blob/master/core/web/Bootstrap.php#L78
  3. Admin url rule collects data and generates the rule from the controller map for the admin module: https://github.com/luyadev/luya-module-admin/blob/master/src/components/UrlRule.php

@nadar nadar added bug and removed bug:research labels Mar 14, 2018
nadar added a commit that referenced this issue Mar 14, 2018
@nadar nadar added this to the 1.1.0 milestone Mar 19, 2018
@nadar nadar closed this as completed Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant