Problem/Motivation

Rebuild cache is hard to find Gin with Navigation module enabled (ie, Drupal CMS default D11 setup). It used to be easy to find within the Toolbar module. It is also misleading UX positioning it contextually within e.g. node edit screen, can make site editors think they are clearing the specific node cache rather than the entire site cache:

Screenshot of where it appears now

Steps to reproduce

  1. Install Drupal CMS
  2. Install Rebuild Cache Access

Proposed resolution

Add to Navigation when/if it gets enabled:

  1. New module install, navigation not yet enabled but gets installed later (hook_modules_installed kicks in)
  2. New module install, navigation already enabled (hook_install kicks in)
  3. Existing module update, navigation already enabled (hook_update_N kicks in)
  4. Existing module update, navigation not yet enabled but gets installed later (hook_modules_installed kicks in)

Remaining tasks

None

User interface changes

Here is how it looks with the MR applied

Screenshot of Rebuild Cache Access in Navigation

API changes

None

Data model changes

None

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

leymannx created an issue. See original summary.

norman.lol’s picture

scott_euser made their first commit to this issue’s fork.

scott_euser’s picture

Title: Gin Toolbar compatibilty » Navigation module & Gin theme compatibilty
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new83.7 KB

Given that Gin is now Drupal CMS + Navigation & Top bar are in place, these actions are typically more suitable now within the Navigation.

This MR creates a block but could use someone to style it to match navigation.

Steps to install:

  1. Ensure dependencies Gin (contrib/Drupal CMS) & Navigation module (Core) are enabled
  2. Go to Admin > Config > Navigation Blocks
  3. Add 'Rebuild cache' in the add block area, untick show title, and Save

There is probably some way to install it automatically but not sure how and probably best as a follow-up.

Here is how it looks now with the MR:

Rebuild cache access within Navigation

scott_euser’s picture

Issue summary: View changes
scott_euser’s picture

StatusFileSize
new15.44 KB

Actually could just leverage the Navigation module:

Rebuild cache button within navigation

Custom icon could be a potential follow-up too, but think its not worth being a blocker.

norman.lol’s picture

Status: Needs review » Needs work

Ah you can just add blocks into the new navbar, okay.

Yeah, we would need to find a ways this gets placed automatically.

@scott – What do you mean with this:

Actually could just leverage the Navigation module

norman.lol’s picture

scott_euser’s picture

This commit essentially https://git.drupalcode.org/project/rebuild_cache_access/-/merge_requests... - no css needed in the end, it just takes the styling from Navigation module defaults so less maintenance burden also if they change things

scott_euser’s picture

Yeah the problem with placing the block is we need to check if navigation is installed, but also need to react if it's not yet installed and later gets installed. I'll see if I can spend a bit more time on this to see how to do that

scott_euser’s picture

Status: Needs work » Needs review

Okay that now handles:

  • New module install, navigation not yet enabled but gets installed later (hook_modules_installed kicks in)
  • New module install, navigation already enabled (hook_install kicks in)
  • Existing module update, navigation already enabled (hook_update_N kicks in)
  • Existing module update, navigation not yet enabled but gets installed later (hook_modules_installed kicks in)

I think this needs a new 2.x to make this Drupal 11+ only

scott_euser’s picture

Issue summary: View changes

Feedback from @AstonVictor addressed btw, back to ready for review. Updated the issue summary to make it more clear

scott_euser’s picture

Issue summary: View changes
StatusFileSize
new45.54 KB
scott_euser’s picture

Added test coverage now as well; @normal.lol anything else you feel you need to help get this over the line?

Note that php next major warning is the existing test coverage missing #[RunTestsInSeparateProcesses], but didn't want to add any scope creep

norman.lol’s picture

Status: Needs review » Fixed

Thank you, Scott! Very well written and thorough piece of work 🤩 Merged ✅

Gets released in a sec.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

scott_euser’s picture

Thank you!

Status: Fixed » Closed (fixed)

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

norman.lol’s picture