diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts index 1dac7e529fa..ba4951b8d85 100644 --- a/public/app/core/services/backend_srv.ts +++ b/public/app/core/services/backend_srv.ts @@ -539,7 +539,9 @@ export class BackendSrv implements BackendService { queryParams.set('accesscontrol', 'true'); } - return this.get(`/api/folders/${uid}?${queryParams.toString()}`); + return this.get(`/api/folders/${uid}?${queryParams.toString()}`, undefined, undefined, { + showErrorAlert: false, + }); } } diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index 5a347f99cb2..b2975758d84 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -449,10 +449,14 @@ function updateStatePageNavFromProps(props: Props, state: State): State { if (folderUid && pageNav) { if (newBrowseDashboardsEnabled()) { const folderNavModel = getNavModel(navIndex, `folder-dashboards-${folderUid}`).main; - pageNav = { - ...pageNav, - parentItem: folderNavModel, - }; + // If the folder hasn't loaded (maybe user doesn't have permission on it?) then + // don't show the "page not found" breadcrumb + if (folderNavModel.id !== 'not-found') { + pageNav = { + ...pageNav, + parentItem: folderNavModel, + }; + } } else { // Check if folder changed if (folderTitle && pageNav.parentItem?.text !== folderTitle) { diff --git a/public/app/features/dashboard/state/initDashboard.ts b/public/app/features/dashboard/state/initDashboard.ts index b22bea87820..eae608bdaa2 100644 --- a/public/app/features/dashboard/state/initDashboard.ts +++ b/public/app/features/dashboard/state/initDashboard.ts @@ -93,8 +93,13 @@ async function fetchDashboard( // get parent folder (if it exists) and put it in the store // this will be used to populate the full breadcrumb trail if (newBrowseDashboardsEnabled() && dashDTO.meta.folderUid) { - await dispatch(getFolderByUid(dashDTO.meta.folderUid)); + try { + await dispatch(getFolderByUid(dashDTO.meta.folderUid)); + } catch (err) { + console.warn('Error fetching parent folder', dashDTO.meta.folderUid, 'for dashboard', err); + } } + if (args.fixUrl && dashDTO.meta.url && !playlistSrv.isPlaying) { // check if the current url is correct (might be old slug) const dashboardUrl = locationUtil.stripBaseFromUrl(dashDTO.meta.url);