Problem/Motivation

FlagCountManagerInterface::getTotals() has a $reset parameter for clearing the static cache. However, this is no longer needed, since as of D7 (!!) functions should use drupal_static() to allow their cache to be cleared.

Proposed resolution

Remove the parameter, and the code that clears the cache when the parameter is set to TRUE.

Remaining tasks

- create a patch
- update the CR at https://www.drupal.org/node/2476349

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gnuget’s picture

Patch attached.

joachim’s picture

Status: Active » Needs review

Thanks for the patch!

Let's see what the testbot says...

Berdir’s picture

Uhm ;)

#1577902: [META] Remove all usages of drupal_static() & drupal_static_reset()

drupal_static() shouldn't be used in services. Which means that some way to reset it is often necessary, but usually in the form of a separate method. It's also usually only necessary for tests.

joachim’s picture

Thanks for the info!

We can still fix this issue as is though, and then move on to changing drupal_static() calls in new one.

joachim’s picture

joachim’s picture

Status: Needs review » Fixed

Tests pass, patch looks good.

Committed, and I'm about to update the CR. EDIT: which doesn't mention the $reset at all, so it's ok already.

Thanks!

  • joachim committed 2b32e27 on 8.x-4.x authored by gnuget
    Issue #2488288 by gnuget: Removed obsolete $reset parameter from...

Status: Fixed » Closed (fixed)

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