Problem/Motivation
Coming here from #3473343: Switch our base to Drupal 11.
Drupal CMS contains a core patch to the navigation module, to add default block config and implement an alter for dashboard support. Since navigation is in core and dashboard is currently in contrib (and Drupal CMS won't be able to have patches applied while also supporting automatic updates), it seems like the default config and alter hook could move to dashboard module instead.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork dashboard-3486246
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
plopescI don't think we can ship that config change as part of the Dashboard module.
Would be great if we could get #3478224: Provide Config Action to add new blocks to navigation from recipes merged to allow to include the dashboard block as part of the corresponding Drupal CMS recipe. Another option would be to add the block to the navigation top programmatically, following the approach in #3463142: Allow modules to hook into top of content section of new core navigation.
Comment #3
plopescRegarding the hook implementation, #3443833: Provide a way for other modules to flag block plugin implementations as 'navigation safe' should be taken into account as well.
Comment #4
penyaskitoCreated #3490031: Mark navigation dashboard block as navigation safe after #3443833: Provide a way for other modules to flag block plugin implementations as 'navigation safe' landed for the Drupal CMS use case.
I'd like to focus this issue on how to provide the block by default in any site with Navigation + Dashboard enabled.
For Drupal CMS this shouldn't be a blocker, as we can provide the config there or use the config action when it lands in the recipe.
Comment #5
penyaskitoThis is postponed on #3478224: Provide Config Action to add new blocks to navigation from recipes landing.
I discussed this today with @plopesc. From all the alternatives, we have, my preference is still using the block.
We would need to implement hook_install (for adding the block), hook_uninstall (for removing the block), and hook_modules_installed (in case navigation is enabled AFTER dashboard).
Comment #6
penyaskitoBefore we work on this, we should wait for #3491081: Allow other modules to include their own Navigation blocks during installation.
If that lands it would simplify a ton the work needed for this.
If it doesn't, we should use that MR code as a reference.
Comment #7
penyaskitoComment #8
penyaskitoComment #10
penyaskitoNow that we have
hook_navigation_defaultshook in core is much easier to implement. This will only work on >=11.2 though.Comment #11
penyaskitoI considered if we should provide an upgrade path adding the block.
But at this point there's a huge chance that people already managed their way to add the block.
As a workaround, they can uninstall navigation or dashboard, whatever doesn't hurt them, and re-install it.
Comment #12
plopescLooks good! This is a nice improvement that will be very helpful.
Comment #14
penyaskitoFixed, thanks!