revolution icon indicating copy to clipboard operation
revolution copied to clipboard

MODX3 - Default dashboard not respecting removal of widgets

Open muzzwood opened this issue 6 years ago • 6 comments

Bug report

Summary

Fresh install of latest MODX 3 dev. Removed some widgets from the default dashboard then saved. Viewed dashboard and all widgets are still there. Went back to the edit dashboard screen and widgets are still removed. So it's saving the changes, it must just be a problem with loading the dashboard.

It appears this only happens with the default dashboard. I created a new dashboard and assigned it to the admin group and it displayed correctly.

Step to reproduce

Remove widgets from default dashboard then view the dashboard.

Observed behavior

All Widgets showed on dashboard screen even though some had been removed.

Expected behavior

Dashboard should not show widgets that have been removed.

Environment

MODX 3.0dev

muzzwood avatar Sep 24 '19 09:09 muzzwood

Isn't editing the default dashboard a no-no anyway because that'll be overwritten on upgrade? Maybe the dashboard should be properly locked now that it's much easier to customise.

Mark-H avatar Sep 24 '19 21:09 Mark-H

Yeah that's a good point. I suppose on the dashboard list page, the "Update dashboard" option should be disabled on the default one. It would be good to somehow make it more clear from first glance that the default needs to be duplicated too. Hmm.. is there a technical (or other) reason the default dashboard is overwritten on upgrade?

muzzwood avatar Sep 25 '19 05:09 muzzwood

I've never had my additions or removals of default widgets changed on upgrade.

sottwell avatar Sep 25 '19 05:09 sottwell

My understanding is the default dashboard will have the default widgets re-added if they've been removed after a MODX upgrade. Other dashboards are left as is.

muzzwood avatar Sep 25 '19 05:09 muzzwood

Well, in any case a better practice would be to create dashboards specific to groups that require modified dashboards.

sottwell avatar Sep 25 '19 07:09 sottwell

I agree with Susan (Upgrade MODX gets added to the default dashboard and has always stayed there through all upgrades). I can confirm that removing widgets from the default dashboard does not remove their records from the dashboard_widget_placement table.

But something else weird seems to be going on with dashboards. The dashboard_widget_placement table now has a 'user' field, though it never has before. AFAIK, individual users don't even have dashboards, much less their own widgets, only user groups do, and there's no way to set a dashboard or a widget for an individual user in the Manager. What, then, is the point of the 'user' field in that table?

Four of the widgets on my fresh MODX3 site appear twice in the dashboard_widget_placement table in the DB, once with a user of 0, and again with a user of 1. Widgets that only appear with a user of 0 don't show up on the dashboard they are attached to.

This broke upgradeMODX in MODX3 because it attaches itself to the default dashboard but doesn't set the user field. With a user of 0 it doesn't appear.

I haven't checked but I think that maybe removing a widget from the default dashboard creates a second record for it with the user field set to 0, without deleting the original record.

BobRay avatar Jun 03 '20 05:06 BobRay