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.
Currently we are looking for the value of the date field according to the language of the node but it is possible to have a multilingual node with an untranslatable date field, in which scenario the value of the field gets stored as und
.
/**
* Determine if the specific node is date-enabled.
*/
function _signup_date_get_node_scheduler($node) {
$field = signup_date_field($node->type);
if (!empty($node->{$field['field_name']}[$node->language][0]['value'])) {
return 'date';
}
// Allow using an untranslatable date field.
if (!empty($node->{$field['field_name']}['und'][0]['value'])) {
return 'date';
}
if (isset($node->{$field['field_name'] . '_value'})) {
return 'date';
}
return 'none';
}
As far as I know this logic is used multiple times in the module, so we should dig in and see which functions are affected. Possibly provide a helper function to get the value of the field.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1426278-5-und-date-field.patch | 2.87 KB | smithmilner |
#4 | 1426278-4-und-date-field.patch | 2.83 KB | smithmilner |
#2 | 1426278-2-und-date-field.patch | 531 bytes | smithmilner |
Comments
Comment #1
Jerenus CreditAttribution: Jerenus commentedA patch needed.
Comment #2
smithmilner CreditAttribution: smithmilner as a volunteer commentedI need this.
Comment #3
smithmilner CreditAttribution: smithmilner as a volunteer commentedComment #4
smithmilner CreditAttribution: smithmilner as a volunteer commentedMy last patch didn't go far enough.
Comment #5
smithmilner CreditAttribution: smithmilner as a volunteer commentedI need this to work with php 5.3. I had to make a small change.