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.
Field.info.inc uses 2 functions that have a additional reset parameter this issues builds on teh pattern introduced in #577950: API-cleanup: Factor module_implements $refresh parameter into it's own function to tidy up some additional functions.
Comment | File | Size | Author |
---|---|---|---|
#13 | field_reset.patch | 6.17 KB | yched |
#12 | field_reset.patch | 6.17 KB | marcingy |
#9 | split-reset-field-info-9.patch | 5.66 KB | marcingy |
#7 | split-reset-field-info-7.patch | 5.65 KB | marcingy |
#4 | split-reset-field-info-4.patch | 5.41 KB | marcingy |
Comments
Comment #1
marcingy CreditAttribution: marcingy commentedComment #2
marcingy CreditAttribution: marcingy commentedComment #3
sunLet's keep "An associative array containing:"
How often is this really called? I'm not sure whether the fast pattern is justified here.
-1 days to next Drupal core point release.
Comment #4
marcingy CreditAttribution: marcingy commentedReroll adding in the array comment and removing fast static.
Comment #5
Lars Toomre CreditAttribution: Lars Toomre commentedI like this $reset clean-up patch. I have not tested it, but reviewing the latest patch, it looks good to go.
Comment #6
sunHm. The correlation between the collator and the reset function isn't obvious unless you already know that both exist. We should prevent people from simply using drupal_static_reset().
Let's add @see respective lines to the end of the phpDocs of both functions.
Comment #7
marcingy CreditAttribution: marcingy commentedHave added @see but I'm not 100% sure they are necessary as these are internal functions given the _field namespacing and external calls should be utilising field_info_cache_clear() rather than calling these functions.
Comment #8
yched CreditAttribution: yched commentedthe @see mentions need () after the function names.
Other than that, fine by me.
Comment #9
marcingy CreditAttribution: marcingy commentedAdding () to @see
Comment #10
yched CreditAttribution: yched commentedThis will probably get refactored with #1040790: _field_info_collate_fields() memory usage (when I can get back to it...), but meanwhile, sounds good.
Comment #11
yched CreditAttribution: yched commentedHm, wait a sec.
_field_info_collate_types() and (mostly) _field_info_collate_fields() can be called quite a bit during a request.
Moving the statics in there over to drupal_static() should have happened long ago (I think there were two concurrent patches somewhere in the queue, that just neutralized each other...), but I'd rather have them use the $drupal_static_fast pattern (as was done in the original patch above).
Comment #12
marcingy CreditAttribution: marcingy commentedBack to drupal fast static pattern.
Comment #13
yched CreditAttribution: yched commentedStraight re-upload for the bot
Comment #14
yched CreditAttribution: yched commentedThanks !
Comment #15
catchLooks like good cleanup, committed and pushed!