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.
In a section of the date_api.install, variables are being set for the site, however one line "gets" the value of a variable, but doesn't assign it to anything. Is this line unnecessary, or is it, in fact, supposed to be setting the variable, instead of getting it.
I attached a patch against the current dev release (1.17)
Comment | File | Size | Author |
---|---|---|---|
fix_get_date_api.install.patch | 571 bytes | michael_kirk | |
Comments
Comment #1
michael_kirk CreditAttribution: michael_kirk commentedforgot to mention:
The variable being get, and not set, is 'date_default_timezone_name'...
variable_get('date_default_timezone_name', NULL);
Comment #2
KarenS CreditAttribution: KarenS commentedThis is done this way by design. If I use variable_set() the value will be overwritten even if it already exists. Using variable_get will set the value if it doesn't exist but not over-write it if it does. I add some documentation to the code to explain that.