backdrop-contrib / date

NOW IN BACKDROP CORE 🎉 Adds a date field.
GNU General Public License v2.0
0 stars 0 forks source link

Undefined Variable in date.install File #4

Closed rolturn closed 9 years ago

rolturn commented 9 years ago

Lines 56 and 60 of date.install is triggering an undefined variable. $db_columns looks like it should be changed to $columns, unless you have other plans for it.

Just thought I would give you a heads up. Thanks for your work on converting this module over to backdrop.

lolandese commented 9 years ago

Yes. Same here. As suggested by @rolturn, an easy fix. Thanks for that.

diff --git a/date.install b/date.install
index 9a27fea..94565ce 100644
--- a/date.install
+++ b/date.install
@@ -53,11 +53,11 @@ function date_field_schema($field) {

   // If a second date is needed for 'End date', make a copy of the first one.
   if (!empty($field['settings']['todate'])) {
-    $db_columns['value2'] = $db_columns['value'];
+    $columns['value2'] = $columns['value'];

     // We don't want Field API to create additional columns, just the first.
     // We modify them our own way in views data.
-    $db_columns['value2']['views'] = FALSE;
+    $columns['value2']['views'] = FALSE;
   }
   // Timezone and offset columns are used only if date-specific dates are used.
   if (isset($field['settings']['tz_handling']) && $field['settings']['tz_handli
Graham-72 commented 9 years ago

Incorporated in commit https://github.com/backdrop-contrib/date/commit/42100ca0e742e91c40417588c2708707c171ad44