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.
Hello.
Follow Drupal 7 architecture we should use drupal_static function
instead of static variables.
This allow external modules to clear static vars if needed.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#2 | nodequeue-use_drupal_static_for_variable_caching-1666556-2.patch | 2.67 KB | Cameron Tod |
#1 | nodequeue_qid_map_static.patch | 508 bytes | igor.ro |
Comments
Comment #1
igor.ro CreditAttribution: igor.ro commentedHere is the patch.
Comment #2
Cameron Tod CreditAttribution: Cameron Tod commentedSome code we are working on here would really benefit from this. static is used instead of drupal_static in several places, not just in nodequeue_get_qid_map().
Comment #3
pfrenssenI need this to be able to run tests on nodequeues that are exported with Features Extra. For the moment I will have to implement my own variants of these functions so I can clear the static caches.
Review:
The ampersand is forgotten in this instance, causing the function not to be passed by reference.
Rest of the patch looks good.
Comment #5
fizk CreditAttribution: fizk commentedCommitted, thanks!