Page not working anymore after installing uc_stock.
Clean install on LEMP
nginx version: nginx/1.4.6 (Ubuntu)
mysql Ver 14.14 Distrib 5.5.44, for debian-linux-gnu (x86_64) using readline 6.3
PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul 2 2015 15:23:08)
Modules installed over drush :
Drupal normal install (completely fresh)
UC non-optional coremodules
uc_stock
Error:
/var/log/nginx/error.log
2015/08/31 10:50:42 [error] 17939#0: *11468 FastCGI sent in stderr: "PHP mess
age: Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFound
Exception: "Route "uc_stock.reports" does not exist." at /var/www/mr2/core/li
b/Drupal/Core/Routing/RouteProvider.php line 176" while reading response head
er from upstream, client: xxx.xxx.xxx.xxx , server: my.domain.ch, requ
est: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:"
Comment | File | Size | Author |
---|---|---|---|
#11 | 2560279-11.patch | 763 bytes | TR |
#9 | 2560279-uc-stock-reports-missing-9.patch | 1.18 KB | david.czinege |
|
Comments
Comment #2
MajorTwip CreditAttribution: MajorTwip commentedEnabling uc_report solves the problem
Please add uc_report to the depencies of uc_stock.
Comment #3
TR CreditAttribution: TR commentedWe definitely don't want uc_report to be a dependency of uc_stock.
The route itself is defined with a dependency in uc_stock.routing.yml, so that uc_stock.reports doesn't exist unless the uc_report module is enabled:
The uc_stock.reports route isn't referred to anywhere else but in uc_stock.links.menu.yml. I would have thought Drupal core would properly handle that, but I guess not.
Where does that error show up - on a page, or just in the logs? When does it happen? Maybe the _module_dependencies key can be used in the links.menu.yml, or maybe this needs a core patch to propagate the dependency.
Comment #4
TR CreditAttribution: TR commentedThis appears to be the same as the issue raised in core: #2315801: Generating a local task based on a missing route causes a crash
Comment #5
MajorTwip CreditAttribution: MajorTwip commentedIt appears immediately after enabling the module (without uc_report enabled) on every access.
I tried with a clean setup, no products added.
Comment #6
longwaveI can reproduce this, it's not quite the same as #2315801: Generating a local task based on a missing route causes a crash as uc_stock.reports is a normal menu item and not a local task. The cause appears to be toolbar.module attempting to render menu subtrees without paying attention to the module requirements. This still needs to be fixed in core rather than Ubercart.
Comment #7
TR CreditAttribution: TR commented#2315801: Generating a local task based on a missing route causes a crash Does mention that the problem occurs with menu items and that the solution should address that as well.
Comment #8
longwaveOh, I didn't read the issue closely enough to spot that. In that case it seems like we could implement hook_menu_links_discovered_alter() similar to dblog_menu_links_discovered_alter() rather than include the link in uc_stock.links.menu.yml, but this still feels like a core bug rather than something we should work around.
Comment #9
david.czinege CreditAttribution: david.czinege at Drupers commentedI fixed this issue.
I implemented the hook_menu_links_discovered_alter() inside the uc_stock.module file.
Inside this hook the uc_stock.reports route is checked, that it is available or not.
If it's available the Stock reports menu link is added under the Store / Reports menu item.
Comment #10
ben.bunk CreditAttribution: ben.bunk commentedThis patch worked for me.
Comment #11
TR CreditAttribution: TR commented@ben.bunk: Can you try this patch instead and see if this one also works for you?
The attached patch takes a different approach. While #9 removes the route from uc_stock.routing.yml then uses hook_menu_links_discovered_alter() to conditionally add the route back in iff uc_report is enabled, my patch here in #11 leaves the route defined in uc_stock.routing.yml then deletes it in hook_menu_links_discovered_alter() if uc_report is not enabled.
The end result of the two patches should be the same - i.e. the route is only defined if uc_report is enabled, but with my patch here the route remains declared in uc_stock.routing.yml which I find valuable as documentation of the uc_stock functionality.
Comment #13
TR CreditAttribution: TR commented(The test failure is due to a Drupal core regression with 8.5.x and has nothing to do with this patch.)
Comment #15
TR CreditAttribution: TR commentedCommitted #11.