Problem/Motivation
I recently did a composer up and moderation_dashboard got upgraded from 1x to 2x, it took me a while to figure out that I could fix the bug by downgrading back to 1.x
Background information:
Note: I'm using several customized page variants and panels
Login at /user/login
results in whitescreen after submitting correct user/password
Steps to reproduce
I xdebugged, there was a redirect happen that threw an exception
Login at /user/login
results in whitescreen after submitting correct user/password
press F5 to refresh a page loads correctly but not to the intended moderation dashboard redirected page, keep testing, log out again, log back in again, same thing.
then I discovered the bug went away when downgrading back to 1.x
Proposed resolution
Downgrade to 1.x
Remaining tasks
Find out why 2.x goes 500 internal server error, some redirect exception.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | moderation-dashboard-500-error-on-login-3326145-23.patch | 1.33 KB | rajiv.singh |
| #22 | moderation-dashboard-500-error-on-login-3326145-22.patch | 975 bytes | rajiv.singh |
| #13 | 3326145-1.patch | 611 bytes | sidheswar |
| #9 | 3326145-stop-deleting-page-manager-moderation-dashboard.patch | 65 bytes | Anonymous (not verified) |
Issue fork moderation_dashboard-3326145
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
smustgrave commentedWell one different in the 2.x version is it doesn’t use panels anymore. Is the panels module being removed by chance?
Comment #3
joseph.olstad@smustgrave, it's weird, the dashboard works with panels, I kept those configurations but the redirect from user/login throws a 500 exception and I used xdebug and it's a redirect type of exception, if I have time I'll put the debugger onto the moderation_dashboard 2.x module code and maybe see what's going on.
Comment #4
smustgrave commentedWill also try to replicate
Comment #5
smustgrave commentedJust following up if you have anything from the logs?
Comment #6
joseph.olstadHi Smustgrave sorry I have no more hints at this time. Basically switching to 1.x solves the problem, if I get a chance I'll have another look at 2.x but I probably need a few months.
Comment #7
smustgrave commentedSo I tried to replicate locally again.
Installed 8.x-1.x of moderation_dashboard.
Switched to 2.0.x branch
Ran drush updb
The redirect route does change between the two branches
8.x-1.x is using 'page_manager.page_view_moderation_dashboard_moderation_dashboard-panels_variant-0'
2.0.x is using 'view.moderation_dashboard.page_1'
I did not run into a 500 error though.
Comment #8
the_g_bomb commentedI am trying to do the upgrade from 1.x to 2.x as well, but am running into the following issue, not sure if it is related:
Comment #9
Anonymous (not verified) commentedI have a rudimentary patch for this issue. I just stopped the update from deleting the moderation dashboard page.
Comment #10
b_manPatch contents removed at request of poster.
Comment #11
joseph.olstadI haven't had a chance to test patch 9 yet but it is very interesting. Good to see that I'm not the only one having an issue with 2x. With that said, one of my sites has a lot of panel variants overriding the dashboard panel. Seeing as 2x does not use panels, it's a significant change that will take a lot of time for us to deal with. With that said, I see that 1.x is D10 compatible so we'll probably be keeping 1.x for a long while yet.
Comment #12
smustgrave commentedYea I'm not taking 1.x down anytime soon just won't be putting any work (major issues excluded) into it. Especially since panels has been marked no further development.
Comment #13
sidheswar commentedAdded a validation condition before deleting the items.
Comment #14
ctrladelAnother confirmation that our site ran in to this while upgrading. Took a long time to track down that this was the cause so I can't confirm that the patch in #13 solves the issue when first encountered but I can confirm that running the code after the delete in the update hook fixed our issue.
drush eval "\Drupal::service('config.installer')->installDefaultConfig('module', 'moderation_dashboard')"Comment #15
smustgrave commentedWill go ahead and merge this at lest.
Comment #16
joseph.olstad@smustgrave, thank you
Comment #17
joseph.olstadFor now we're still using 1x with D10.0.10 because I've got panel variants and we need panels. It would be significant to refactor our implementation and panels is working well for us.
Comment #19
joseph.olstad@smustgrave, actually we didn't see the merge, perhaps you forgot to push it up?
Comment #21
smustgrave commentedNot sure what happened there.
Comment #22
rajiv.singh commentedUpgraded to 3.1 for Drupal 11 , but 500 error after login is still there
What This Fix Does
Prevents the "Route 'view.moderation_dashboard.page_1' does not exist" error (HTTP 500 on login)
If the route doesn't exist, the exception is caught and the redirect is skipped
No service definition changes required
Minimal code change
This is the minimal fix that handles the missing route without adding dependencies or view checks. The error should now be resolved, and login will work even if the moderation dashboard route doesn't exist.
Comment #23
rajiv.singh commentedThe previous Patch was only solving the 500 error but it was not redirecting the correct mod_dashboard page .
Problem
After the upgrade, the moderation dashboard uses Page Manager, but ResponseSubscriber.php still references the old Views route view.moderation_dashboard.page_1, which no longer exists.
Solution
Updated ResponseSubscriber.php to use the path directly (/user/{user}/moderation/dashboard) instead of the non-existent Views route.
Changes made:
Replaced Url::fromRoute('view.moderation_dashboard.page_1', ...) with Url::fromUserInput('/user/' . $this->currentUser->id() . '/moderation/dashboard')
This matches the path defined in the Page Manager config (page_manager.page.moderation_dashboard.yml)