Under the flush caches item in the admin menu, there is an item "Page and else", which isn't meaningful.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Title: Strange menu item "Page and else" » Find a better link title for "[Flush] Page and else [cache]"
Version: 7.x-3.0-rc2 » 7.x-3.x-dev
Category: bug » task

Better suggestions welcome.

Note that the link's title is used as a sentence fragment in the confirmation message after the cache flush operation has been performed.

Thus, the resulting confirmation message is:

Page and else cache cleared.

In other words: !link-title cache cleared.

This was done to keep the API of hook_admin_menu_cache_info() simple. See admin_menu.api.php for details.

xenophyle’s picture

Yes, so once the label is changed, it will fix the confirmation message too.

I would make a suggestion, but I'm not sure what gets cleared with this menu link. There used to be a clear-cache link called "Page requisites", but I think that was what is now called CSS & JavaScript.

By the way, I love this module and couldn't get anything done without it. It's the first module I install on every site I work on.

sun’s picture

Yup, that's sorta the challenge here.

The "Page and else" literally means the page cache and "any other cache tables of core or contributed modules".

The only stuff that is omitted are the other precisely identifiable caches, for which separate cache flushing links exist.

xenophyle’s picture

Yeah, I guess it's hard to come up with a snappy name for such a miscellaneous collection, especially when it needs to work in !link-title cache cleared.

At least it should be changed to "Page and other", since "else" doesn't make sense.

sun’s picture

Is the resulting message proper grammar then?

"Page and other cache cleared."

Somehow sounds wrong to me, but perhaps I'm mistaken.

xenophyle’s picture

Ideally it should be "Page and other caches cleared" since there's more than one cache (no matter what the label is).

ahoeben’s picture

How about simply "Content" (resulting in "Content cache cleared")?
That is the terminology that is used in the rest of Drupal.

xenophyle’s picture

If "content cache" is the same data as what is now called "page and else", that works for me :)

dynamicdan’s picture

1 month later? No change? +1 for 'Content cache'.

christefano’s picture

+1 for the "content cache" wording.

ahoeben’s picture

FileSize
521 bytes

Does it help if I create a patch?

christefano’s picture

Status: Active » Needs review
FileSize
527 bytes

ahoeben, here's one for "Content cache", adapted from your patch. Marking needs review.

Status: Needs review » Needs work

The last submitted patch, 1580008_admin_menu_content_cache.patch, failed testing.

ahoeben’s picture

@christefano, the " cache" gets added automatically to the "Content cache cleared." message , so your version would lead to "Content cache cache cleared."

ahoeben’s picture

FileSize
563 bytes
Valentine94’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
463 bytes

Re-roll. Please review.

xenophyle’s picture

Status: Needs review » Needs work

Looks good, but change 'Content cache' to 'Content' as per comment #14.

xenophyle’s picture

Status: Needs work » Needs review
FileSize
426 bytes

Or I can try submitting a patch...

Status: Needs review » Needs work

The last submitted patch, 18: find_a_better_link-1580008-18.patch, failed testing.

xenophyle’s picture

Status: Needs work » Needs review
FileSize
457 bytes

Trying again.

calebtr’s picture

Status: Needs review » Reviewed & tested by the community

#20 applies and works as advertised. After clearing caches, naturally. No one has objected to changing this to 'Content' in three years, so, RTBC.

Valentine94’s picture

Looks good to me. +1

The last submitted patch, 15: page_and_else.patch, failed testing.

Dhruv Panchal’s picture

Hello,

Please use this drupal function to exclude cache : drupal_page_is_cacheable(FALSE);

Thanks,
Dhruv Panchal

truls1502’s picture

Status: Reviewed & tested by the community » Active

I think it is better to leave it open a while to let see what Drupal community prefer regarding the spelling.

calebtr’s picture

Good idea. Six years is clearly not long enough for this community to agree on anything, least of all improvements to user experience.

It has only been about 3 and half years since the last suggestion, so we should give the community some more time to chime in. We've probably got a few months to two years before Drupal 7 officially reaches end-of-life, and if no speaks up before then, well, it is Drupal tradition to strive for perfection, lest we should come up with solutions that are merely good.

If maintainers don't care, just close the issue and mark it won't fix.

truls1502’s picture

I know and I am agreed with you.

However, I have recently involved in the project which I feel wrong to take the last word about it, I need more feedback. Therefore, I will leave it open for some weeks to see what the current active Drupal users prefer. I will make sure and try to not let the issues be open for years.

calebtr’s picture

Thanks for taking it on, and good luck!

joelpittet’s picture

The current one is more correct IMO, I'm -1 for the current patch.

It's emulating core's drupal_flush_all_caches() which does page, bootstrap, filter, cache and anything that implements HOOK_flush_caches()

Anonymous’s picture

It's emulating core's drupal_flush_all_caches() which does page, bootstrap, filter, cache and anything that implements HOOK_flush_caches()

It's not exactly emulating drupal_flush_all_caches(). Perhaps it should be titled to reflect that it only flushes cache bins. drupal_flush_all_caches() (which is also called if you click the "Flush all caches" menu item) does the following:

  // Change query-strings on css/js files to enforce reload for all users.
  _drupal_flush_css_js();
  registry_rebuild();
  drupal_clear_css_cache();
  drupal_clear_js_cache();

  // Rebuild the theme data. Note that the module data is rebuilt above, as
  // part of registry_rebuild().
  system_rebuild_theme_data();
  drupal_theme_rebuild();
  entity_info_cache_clear();
  node_types_rebuild();

  // node_menu() defines menu items based on node types so it needs to come
  // after node types are rebuilt.
  menu_rebuild();

  // Synchronize to catch any actions that were added or removed.
  actions_synchronize();

   // Don't clear cache_form - in-progress form submissions may break.
  // Ordered so clearing the page cache will always be the last action.
  $core = array(
    'cache',
    'cache_path',
    'cache_filter',
    'cache_bootstrap',
    'cache_page',
  );
  $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
  foreach ($cache_tables as $table) {
    cache_clear_all('*', $table, TRUE);
  }

  // Rebuild the bootstrap module list. We do this here so that developers
  // can get new hook_boot() implementations registered without having to
  // write a hook_update_N() function.
  _system_update_bootstrap_status();

While the so-called "Page and else" link only executes:

  // Don't clear cache_form - in-progress form submissions may break.
  // Ordered so clearing the page cache will always be the last action.
  // @see drupal_flush_all_caches()
  $core = array('cache', 'cache_bootstrap', 'cache_filter', 'cache_page');
  $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
  foreach ($cache_tables as $table) {
    cache_clear_all('*', $table, TRUE);
  }

So it's function is to allow a limited cache clear that doesn't go through the rest of the normal cache clearing/rebuilding process by limiting the clear to known cache bins and not invoking the full rebuild process.