Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The code in rebuild.php to clear the user local caches has a couple of issues.
1. array_walk accepts the first array parameter by reference, so not passing a variable here generates warnings
2. array_walk passes the value as the first parameter and the key and the second to the callback function. So in PHP7 the call to apcu_clear_cache() is meant to have 0 parameters but it does not.
See https://3v4l.org/pS2ru for an example of this.
Proposed resolution
Use array_map instead, this was initially a problem in drush, see https://github.com/drush-ops/drush/pull/2451
Remaining tasks
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#2 | 2829578.patch | 451 bytes | damiankloip |
Comments
Comment #2
damiankloip CreditAttribution: damiankloip commentedComment #3
damiankloip CreditAttribution: damiankloip commentedComment #4
damiankloip CreditAttribution: damiankloip commentedComment #5
damiankloip CreditAttribution: damiankloip commentedComment #6
slasher13Comment #8
catchCommitted/pushed to 8.3.x, but this doesn't apply to 8.2.x so needs a re-roll.
Comment #9
damiankloip CreditAttribution: damiankloip commentedCatch, 8.2.x only tries to clear the APCu code, so this fix doesn't really apply. Unless we want to port the support for the other caches over too? But that would have been done in the original patch if so?
Comment #10
catchNo that's fine I just didn't remember this hunk was only in 8.3.x, and didn't look at 8.2.x to see why it didn't apply. If we did have that code it would've been eligible...