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.

Command icon 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

joseph.olstad created an issue. See original summary.

smustgrave’s picture

Well one different in the 2.x version is it doesn’t use panels anymore. Is the panels module being removed by chance?

joseph.olstad’s picture

@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.

smustgrave’s picture

Will also try to replicate

smustgrave’s picture

Just following up if you have anything from the logs?

joseph.olstad’s picture

Hi 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.

smustgrave’s picture

So I tried to replicate locally again.

Installed 8.x-1.x of moderation_dashboard.
Switched to 2.0.x branch
Ran drush updb

>  [notice] Update started: moderation_dashboard_update_8102
>  [notice] views.view.moderation_dashboard did not exist module config was reimported
>  [notice] Update completed: moderation_dashboard_update_8102

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.

the_g_bomb’s picture

I 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:

 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > 

>  [notice] Update started: moderation_dashboard_update_8102
>  [error]  Call to a member function delete() on null 
>  [error]  Update failed: moderation_dashboard_update_8102 
 [error]  Update aborted by: moderation_dashboard_update_8102 
 [error]  Finished performing updates. 
Failed to run drush updb: exit status 1
Anonymous’s picture

I have a rudimentary patch for this issue. I just stopped the update from deleting the moderation dashboard page.

b_man’s picture

Patch contents removed at request of poster.

joseph.olstad’s picture

I 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.

smustgrave’s picture

Yea 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.

sidheswar’s picture

StatusFileSize
new611 bytes

Added a validation condition before deleting the items.

ctrladel’s picture

Status: Active » Needs review

Another 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')"

smustgrave’s picture

Version: 2.1.1 » 2.0.x-dev
Assigned: joseph.olstad » Unassigned
Status: Needs review » Fixed

Will go ahead and merge this at lest.

joseph.olstad’s picture

@smustgrave, thank you

joseph.olstad’s picture

For 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joseph.olstad’s picture

@smustgrave, actually we didn't see the merge, perhaps you forgot to push it up?

smustgrave’s picture

Not sure what happened there.

rajiv.singh’s picture

Upgraded 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.

rajiv.singh’s picture

The 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)