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.
I am running into an issue where date_api_fields is being called with an empty base. This causes it to fall through to the _date_api_fields() call which has this code at the top:
// Make sure $base is never empty.
if (empty($base)) {
$base = 'node';
}
Shouldn't that code be in both places so that when the _date_api_fields() result is cached it will get picked-up in the next request?
Comment | File | Size | Author |
---|---|---|---|
#6 | date_date_api_fields-1771022-6.patch | 3.38 KB | hefox |
#4 | date-base_is_null-1630780-6137380.patch | 637 bytes | jblumenfeld |
#1 | date-base_is_null-1630780-1.patch | 639 bytes | jblumenfeld |
Comments
Comment #1
jblumenfeld CreditAttribution: jblumenfeld commentedAttaching proposed patch
Comment #2
jblumenfeld CreditAttribution: jblumenfeld commentedAttached patch needs review.
Comment #4
jblumenfeld CreditAttribution: jblumenfeld commentedUpdated patch?
It was working on my local pressflow checkout...
Comment #5
jblumenfeld CreditAttribution: jblumenfeld commentedComment #6
hefox CreditAttribution: hefox commentedPatch adapted from duplicate #1771022: date_api_fields slams cache + some other things to help with the performance of the the function
* Removed the cache_clear_all($cid, 'cache_views'); since it's not needed with the cache_set
* did !isset instead of empty( so it doesn't keep looking if _date_api_fields returned empty
* Moved the require_once to only when it's needed, and changed it to a more performant way of including that are always in the same directory as current file (filefield does this for it's includes)
Comment #7
jcisio CreditAttribution: jcisio commentedPatch #4 looks good. Patch #6 IMO is a little too big to be committed, especially when nobody takes care of Date (and even worse, D6).
Comment #8
DamienMcKennaUnfortunately the D6 version of this module is no longer supported, but we appreciate the time you put into this. If this problem is relevant for D7 too, please reopen the issue. Thanks.