- Issue created by @zaporylie
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Nice catch!
layout_builder.dashboard.view action has appears_on dashboard, but if there's no default dashboard for the user, that's a WSOD.
I'm wondering how we can dinamically alter that, while it depends on the user. Is not an action that can be cached sitewide or anything. - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
We need to still check how this will work with caching, but any solution would look similar to this.
- Status changed to Needs work
over 1 year ago 8:55am 20 July 2023 - π³π΄Norway zaporylie
-
+++ b/src/Plugin/Menu/LocalAction/DashboardLocalAction.php @@ -56,10 +57,36 @@ class DashboardLocalAction extends LocalActionDefault { + if ($dashboard !== NULL) {
IMHO it makes sense here to check if dashboard is in fact an instance of DashboardInterface.
-
+++ b/src/Plugin/Menu/LocalAction/DashboardLocalAction.php @@ -56,10 +57,36 @@ class DashboardLocalAction extends LocalActionDefault { + $dashboard = $this->dashboardManager->getDefaultDashboard();
This object instance makes a call to getDefaultDashboard 3 times - in getRouteParams, getRouteName and getTitle. For the performance reasons the default dashboard retrieval can be moved to constructor and the default dashboard could be stored as member variable.
I guess we're also lacking some test coverage.
-
- π³π΄Norway zaporylie
One more thing now I think about it - I am afraid that swapping action link could be problematic given each one has different access criteria so users with edit layout permission may not necessarily also have access to manage dashboards? Just thinking out loud here, perhaps that's not an issue.
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
That's something we need to test. My assumption was than if the user has no access, the link is not shown, but a WSOD is avoided. But definitely need to verify AND we need automated tests for this.
- Assigned to plopesc
- πͺπΈSpain plopesc Valladolid
Working on tests during contrib sprints.
- Status changed to Needs review
about 1 year ago 2:56pm 19 October 2023 - πͺπΈSpain plopesc Valladolid
Hi.
Adding a new version of the patch following a different approach. It adds a custom access checker to dashboard page throwing a 403 error when the user does not have access to view any dashboard.
- Status changed to Needs work
about 1 year ago 12:06pm 20 October 2023 - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Patch looks good, but doesn't apply anymore.
- Status changed to Needs review
about 1 year ago 3:08pm 20 October 2023 - Merge request !2Issue #3375471 by plopesc, penyaskito, zaporylie: DashboardLocalAction results... β (Merged) created by plopesc
- πͺπΈSpain ckrina Barcelona
I opened&closed the MR to see if Tugboat appeared.
-
penyaskito β
committed ce46bdd5 on 2.x authored by
plopesc β
Issue #3375471 by plopesc, penyaskito, zaporylie: DashboardLocalAction...
-
penyaskito β
committed ce46bdd5 on 2.x authored by
plopesc β
- Status changed to Fixed
7 months ago 9:01am 16 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.