From 5e2ff763cd4ef504133b3ab6b6e6f280b0133c95 Mon Sep 17 00:00:00 2001
From: Robert
Date: Mon, 22 Mar 2021 11:00:10 +0100
Subject: [PATCH] Drupal: update modules (Data, Redirect)
---
.../sites/all/modules/date/CHANGELOG.txt | 1872 +++++++++++------
.../drupal/sites/all/modules/date/README.txt | 264 +--
.../sites/all/modules/date/date.api.php | 64 +-
.../all/modules/date/date.devel_generate.inc | 24 +-
.../sites/all/modules/date/date.diff.inc | 1 -
.../sites/all/modules/date/date.field.inc | 94 +-
.../drupal/sites/all/modules/date/date.info | 42 +-
.../sites/all/modules/date/date.install | 117 +-
.../sites/all/modules/date/date.migrate.inc | 22 +-
.../drupal/sites/all/modules/date/date.module | 96 +-
.../drupal/sites/all/modules/date/date.theme | 137 +-
.../sites/all/modules/date/date.tokens.inc | 4 +-
.../sites/all/modules/date/date_admin.inc | 14 +-
.../sites/all/modules/date/date_admin.js | 128 +-
.../all/modules/date/date_all_day/README.txt | 14 +-
.../date/date_all_day/date_all_day.info | 16 +-
.../date/date_all_day/date_all_day.install | 113 +
.../date/date_all_day/date_all_day.module | 215 +-
.../tests/DateAllDayUiTestCase.test | 104 +
.../tests/DateAllDayUpdatesTest.test | 151 ++
...l_day_test_feature.features.field_base.inc | 70 +
...y_test_feature.features.field_instance.inc | 123 ++
.../date_all_day_test_feature.features.inc | 24 +
.../date_all_day_test_feature.info | 21 +
.../date_all_day_test_feature.install | 16 +
.../date_all_day_test_feature.module | 8 +
.../all/modules/date/date_api/README.txt | 256 +++
.../all/modules/date/date_api/date-rtl.css | 3 +-
.../sites/all/modules/date/date_api/date.css | 32 +-
.../all/modules/date/date_api/date_api.info | 13 +-
.../modules/date/date_api/date_api.install | 18 +-
.../all/modules/date/date_api/date_api.module | 251 ++-
.../date/date_api/date_api_elements.inc | 93 +-
.../modules/date/date_api/date_api_ical.inc | 217 +-
.../modules/date/date_api/date_api_sql.inc | 100 +-
.../modules/date/date_api/date_year_range.js | 391 ++--
.../date/date_api/tests/DateApiTestCase.test | 438 ++++
.../date_api/tests/DateApiUnitTestCase.test | 267 +++
.../all/modules/date/date_api/theme/theme.inc | 10 +-
.../date/date_context/date_context.info | 13 +-
.../date/date_context/date_context.module | 7 +-
.../plugins/date_context_date_condition.inc | 17 +-
.../sites/all/modules/date/date_elements.inc | 177 +-
.../date/date_migrate/date_migrate.info | 7 +-
.../all/modules/date/date_popup/README.txt | 4 +
.../modules/date/date_popup/date_popup.info | 17 +-
.../all/modules/date/date_popup/date_popup.js | 25 +-
.../modules/date/date_popup/date_popup.module | 207 +-
.../tests/DatePopupFieldTestCase.test | 64 +
.../tests/DatePopupValidationTestCase.test | 44 +
.../tests/DateViewsPopupTestCase.test | 112 +
.../date/date_popup/themes/datepicker.1.7.css | 227 +-
.../date_popup/themes/jquery.timeentry.css | 6 +-
.../sites/all/modules/date/date_repeat.inc | 1 +
.../modules/date/date_repeat/date_repeat.info | 11 +-
.../date/date_repeat/date_repeat.module | 31 +-
.../date/date_repeat/date_repeat_calc.inc | 182 +-
.../date/date_repeat/date_repeat_form.inc | 34 +-
.../date/date_repeat/tests/date_repeat.test | 198 +-
.../date_repeat/tests/date_repeat_form.test | 87 +-
.../modules/date/date_repeat_field/README.txt | 6 +-
.../date_repeat_field/date_repeat_field.css | 5 +
.../date_repeat_field.devel_generate.inc | 16 +-
.../date_repeat_field/date_repeat_field.info | 17 +-
.../date_repeat_field.module | 146 +-
.../date_tools/date_tools.change_type.inc | 19 +-
.../modules/date/date_tools/date_tools.info | 14 +-
.../modules/date/date_tools/date_tools.module | 44 +-
.../date/date_tools/date_tools.wizard.inc | 40 +-
.../date_tools/tests/DateToolsTestCase.test | 124 ++
.../date/date_views/css/date_views.css | 18 +-
.../modules/date/date_views/date_views.info | 17 +-
.../modules/date/date_views/date_views.module | 110 +-
.../date_views/includes/date_views.views.inc | 21 +-
.../includes/date_views_argument_handler.inc | 59 +-
.../date_views_argument_handler_simple.inc | 113 +-
.../date_views/includes/date_views_fields.inc | 9 +-
.../includes/date_views_filter_handler.inc | 52 +-
.../date_views_filter_handler_simple.inc | 210 +-
.../includes/date_views_plugin_pager.inc | 181 +-
.../date_views/tests/date_views_filter.test | 515 +++++
.../date_views/tests/date_views_pager.test | 137 ++
.../theme/date-views-filter-form.tpl.php | 59 +-
.../date_views/theme/date-views-pager.tpl.php | 24 +-
.../modules/date/date_views/theme/theme.inc | 17 +-
.../modules/date/tests/DateEmwTestCase.test | 143 ++
.../modules/date/tests/DateFieldTestBase.test | 406 ++++
.../modules/date/tests/DateFieldTestCase.test | 59 +
.../modules/date/tests/DateFormTestCase.test | 39 +
.../date/tests/DateMigrateTestCase.test | 95 +
.../date/tests/DateNowUnitTestCase.test | 64 +
.../date/tests/DateTimezoneTestCase.test | 264 +++
.../modules/date/tests/DateUiTestCase.test | 85 +
.../date/tests/DateValidationTestCase.test | 167 ++
.../date_migrate_test/date_migrate_test.info | 22 +
.../date_migrate_test.install | 13 +
.../date_migrate_test.migrate.inc | 132 ++
.../date_migrate_test.module | 19 +
.../tests/date_migrate_test/example_data.xml | 60 +
.../date/tests/date_test/date_test.info | 9 +-
.../date/tests/date_test/date_test.module | 2 +-
.../date_test_feature.features.field_base.inc | 271 +++
...e_test_feature.features.field_instance.inc | 485 +++++
.../date_test_feature.features.inc | 24 +
.../date_test_feature/date_test_feature.info | 34 +
.../date_test_feature.install | 16 +
.../date_test_feature.module | 8 +
.../sites/all/modules/redirect/README.txt | 89 +-
.../all/modules/redirect/redirect.admin.inc | 89 +-
.../all/modules/redirect/redirect.api.php | 16 +-
.../modules/redirect/redirect.controller.inc | 0
.../all/modules/redirect/redirect.drush.inc | 56 +
.../modules/redirect/redirect.generate.inc | 2 +-
.../sites/all/modules/redirect/redirect.info | 9 +-
.../all/modules/redirect/redirect.install | 216 +-
.../all/modules/redirect/redirect.migrate.inc | 186 ++
.../all/modules/redirect/redirect.module | 247 ++-
.../sites/all/modules/redirect/redirect.test | 79 +-
.../modules/redirect/views/redirect.views.inc | 23 +-
...direct_handler_field_redirect_redirect.inc | 2 +-
...redirect_handler_field_redirect_source.inc | 2 +-
.../all/modules/redirect/views/redirects.view | 2 +-
122 files changed, 9695 insertions(+), 3027 deletions(-)
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/date_all_day.install
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/DateAllDayUiTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/DateAllDayUpdatesTest.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_base.inc
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_instance.inc
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.inc
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.info
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.install
create mode 100644 frontend/drupal/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.module
create mode 100644 frontend/drupal/sites/all/modules/date/date_api/README.txt
create mode 100644 frontend/drupal/sites/all/modules/date/date_api/tests/DateApiTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_api/tests/DateApiUnitTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_popup/tests/DatePopupFieldTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_popup/tests/DatePopupValidationTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_popup/tests/DateViewsPopupTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_tools/tests/DateToolsTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_views/tests/date_views_filter.test
create mode 100644 frontend/drupal/sites/all/modules/date/date_views/tests/date_views_pager.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateEmwTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateFieldTestBase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateFieldTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateFormTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateMigrateTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateNowUnitTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateTimezoneTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateUiTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/DateValidationTestCase.test
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.info
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.install
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.migrate.inc
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.module
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_migrate_test/example_data.xml
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_base.inc
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_instance.inc
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.inc
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_test_feature/date_test_feature.info
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_test_feature/date_test_feature.install
create mode 100644 frontend/drupal/sites/all/modules/date/tests/date_test_feature/date_test_feature.module
mode change 100644 => 100755 frontend/drupal/sites/all/modules/redirect/redirect.controller.inc
create mode 100644 frontend/drupal/sites/all/modules/redirect/redirect.migrate.inc
diff --git a/frontend/drupal/sites/all/modules/date/CHANGELOG.txt b/frontend/drupal/sites/all/modules/date/CHANGELOG.txt
index e5e655e27..dbdcb43c2 100644
--- a/frontend/drupal/sites/all/modules/date/CHANGELOG.txt
+++ b/frontend/drupal/sites/all/modules/date/CHANGELOG.txt
@@ -1,674 +1,1282 @@
-Date Module 7.x
-=================
+Date 7.x-2.11, 2021-03-05
+-------------------------
+#3177831 by DamienMcKenna: Add test coverage for the All Day functionality.
+#3197985 by DamienMcKenna: Expand unit tests for date_is_all_day().
+#3197561 by DamienMcKenna: Add functional tests for All Day output.
+#3016390 by DamienMcKenna, mr.york, steinmb, joseph.olstad, lily.yan,
+ solideogloria, nagy.balint, micahw156, Kevin Morse: Change in "All day"
+ end-of-day definition broke existing data.
+#3164305 by DamienMcKenna, FranckyLFS, hughworm, preethy211, joelpittet,
+ lavamind, derekw, leendertdb: Notices in theme_date_display_combination()
+ after upgrading to PHP 7.4.
+#2123039 by DamienMcKenna, hgoto, RoSk0, joelpittet, torotil: Default timezone
+ setting mismatch in metadata wrapper integration.
-======================
-Version 7.x-2.8
-======================
-- Issue #106713 by vijaycs85, heddn: Date Field title XSS(SA)
-- Issue #2310123 by Temoor: Fixed Fatal error in Migrate UI by Date Migrate Example.
-- Issue #2142277 by Temoor | lliss: Fixed Infinite Loop When Using Repeating Dates.
-- Issue #1871136 by Temoor | funkimunky: Fixed Cannot remove migrate example content type.
-- Issue #2261395 by minorOffense | kristofferwiklund: Fixed date_now is not respecting changes to timezone.
-- Issue #1832400 by imot3k, balintk: Fixed "The year/month/... is missing" error message is not translatable.
-- Issue #998076 by coredumperror, joelcollinsdc, brenk28: Fixed Problem with timezone handling (caused by date_get_timezone_db returning only UTC).
-- Issue #1976014 by Harmageddon: Remove unnecessary in date views pager.
-- Issue #2198807 by stickywes: Refactor field tests to utilize DateFieldBasic.
-- Issue #2146461 by vijaycs85 | Razia_b: Fixed Translated field's label is not used in its validation messages.
-- Issue #1874422 by bluetegu, brockfanning, rv0: Fixed Week pager may cause incorrect "next" link on year change.
-- Issue #2167015 by schifazl: HTML output breaks validation and accessibility.
-- Issue #2200513 by scor: Fix encoding issues in CHANGELOG.txt.
-- Issue #2115377 by coredumperror: Notice: Undefined index: add_microdata in theme_date_display_single().
-- Issue #2178299 by sandykadam | joachim: Incorrect variable name in hook_views_data_alter().
-- Issue #1431952 by Cadila | Shawn DeArmond: Date field will only set in Rules if it already has a value.
-- Issue #355058 by Grimreaper | prunelle: Hardcoded day/month/week output format for theme_date_nav_title().
-- Issue #1968828 by pjcdawkins: Replace field_info_fields() with field_info_field_map() for Drupal >= 7.22.
-- Issue #2167033 by podarok, vijaycs85: Fixing tests in 2014 .
-======================
-Version 7.x-2.7
-======================
-- Issue #1691342 by Cyberwolf: Field description is displayed multiple times.
-- Issue #1668240 by ianthomas_uk: /themes/jquery.timeentry.css is not aggregated with other CSS files.
-- Issue #1974056 by pjcdawkins: Add a CSS class to the date repeat rule.
-- Issue #2065749 by vijaycs85, blackdog: $class in theme_date_repeat_rrule is not used.
-- Issue #1840008 by cr0ss, Alan D.: Unlock "Date attributes" (granularity) field setting.
-- Issue #1580032 by jmuzz | 30equals: Date values are not being saved when field is used in a nested field collection.
-- Issue #2071629 by blackdog: #after_build wrongly added, overwrites other modules.
-- Issue #1869962 by kaidjohnson: Date Context breaks context edit form.
-- Issue #1571258 by David_Rothstein | ddalvi: Date and time form elements do not have accessible labels when the label position is set to 'Within' or 'None'.
-- Issue #2130575 by kostajh: Unset() should be used with more caution in views_filter_handler_simple().inc.
-- Issue #1826598 by eromba, jyee: 'c' and 'r' formatter causes date to be printed twice in views.
-- Issue #1933472 by minorOffense: Added Optimize date_now() function.
-- Issue #1248786 by kenneth.venken | dboulet: Fixed appearance of marker for required date fields.
-- Issue #1810734 by ParisLiakos: Fixed Repeat checkboxes working reversed with updated jQuery.
-- Issue #1844092 by dboulet, kardave, Spleshka: Fixed Untranslated strings: month, day, ...
-- Issue #1202248 by james.williams, dawehner, mikehues | DamienMcKenna: Fixed Exported view doesn't include 'default_argument_options()' attribute.
-- Issue #1409120 by anrikun, akamustang | marsbidon: Added Date format in views exposed filter does not respect configured format.
-- Issue #1858112 by tomdearden: Fixed DateObject->difference not calculating correctly for future dates > 1 year away.
-- Issue #1659466 by artkon: Fixed Date filter does not remember value in views if the identifier is something other than date_filter().
-- Issue #1905096 by gielfeldt: Fixed Wrong usage of database API.
-- Issue #1791804 by 5n00py: Errors on form validation if date field placed in sub-form.
-- Issue #636208 Date range: Expose a single filter to select events that start before the chosen date and end after the chosen date by anrikun.
-- Issue #2024269 Date popup documentation fix by RoySegall.
-- Issue #1835184 by Steven Jones, das-peter, jwhat: Fixed date_limit_format() can have poor performance.
-- Issue #991830 by milesw | restyler: Fixed validation errors when date_popup() date is localized.
-- Issue #2098715 by jhodgdon: Fixed Date field not obeying widget alters for #required.
-- Issue #1266688 by linclark, rbayliss, fago, colette: Support microdata in date fields.
-- Issue #1863610 by maximpodorov: Fixed Invalid date formatting.
-- META #2034231 #1832544 Class registration for Migrate 2.5 or later - mikeryan, [#1835214] Automated tests failing - Exception thrown in Date2 migration - PatchRanger, [#
-- Issue #1350604 by Alan D., johaziel: Added Diff support for Date fields.
-- Issue #2086313 by dooug: Fixed Wrong path in date_popup() README.txt
-- Issue #1455558 by BTMash | mediameriquat: Fixed Missing file in date_views().info causes error 500.
-- Issue #1697322 by Alan D., ianmthomasuk | pandikamal: Fixed Call to a member function getName() on a non-object in date api.
-- Code cleanup, remove #prev values that were never used in repeat functionality.
-- Small fix needed to ensure cardinality gets set correctly if repeat option is changed in the UI.
+Date 7.x-2.11-rc1, 2020-10-02
+-----------------------------
+#3084897 by steinmb, Chris Matthews: Fix the LICENSE.txt.
+#2692215 by DamienMcKenna, stickgrinder, zread: Unconditioned access to
+ non-existent array key in date.theme.
+#3111299 by DamienMcKenna: Test refactoring, split out Date Popup tests, move
+ tests to appropriate submodule.
+#2457423 by Liam Morland, ckellyirish, mparker17, DamienMcKenna, bmateus,
+ sagannotcarl, katannshaw, Max1, alansaunders92, derekw, alex awg 2015,
+ truman_ru, wylbur, nicrodgers, ninabyte, Michele Wickham, iStryker, dsdeiz,
+ anpolimus, captainack, ashzade, brad.bulger, cameronprince, Chris Matthews,
+ Vali Hutchison, jenlampton, vishal.sheladiya, jshosseini, akolahi:
+ Incorrectly-initialized DateTime object(s) cause PHP warnings in
+ DateTime::format(), other DateObject functions.
+#2595957 by aurelianzaha, DamienMcKenna, hgoto, klausi, pedrogk, FireHawkX,
+ Chris Matthews: Field label not displayed when rendering as regular field and
+ only using year.
+#2359653 by iamEAP, Sweetchuck, franxo, DamienMcKenna: Validation doesn't take
+ into account translations of AM or PM.
+#3096720 by Liam Morland, ebremner: date_is_all_day() returns FALSE when
+ $granularity is not 'hour' or finer.
+#1257024 by joseph.olstad, maxocub, steinmb, iMiksu, DamienMcKenna, acbramley:
+ Required Date popup field not showing red asterisk.
+#3145639 by Ronino, joelpittet: Curly brace syntax for accessing array elements
+ and string offsets has been deprecated in PHP 7.4.
+#2930732 by NuWans, DamienMcKenna: PHP warning on file_exists fail.
+#3161408 by DamienMcKenna, Ronino: Test failure in DateMigrateTestCase.
+#3163293 by Steven Jones, joseph.olstad: date_update_7007 will fail with
+ different field storage backends.
+#2848963 by joelpittet, DamienMcKenna: date_views_filter_handler_simple
+ ::operators call t() a lot.
+#1762612 by moymilo, cafuego, tamahome14, vanshyr, plachance, steinmb: Error
+ "OLD used in query that is not in a rule" in date_api_update_7000 with pgsql.
+#3168045 by DamienMcKenna: DateFieldTestBase::dateForm extended incorrectly.
+#3168034 by DamienMcKenna: Refactor date_migrate_example to be reusable.
-======================
-Version 7.x-2.6
-======================
-- Issue #1423364 by catmat, Add file and path to hook_context_plugins().
-- Issue #1713248, Remove incorrect use of date_popup() function in previous commit.
-- Issue #1143680 by kristiaanvandeneynde, Make Date Popup widget able to accept custom settings.
-- Issue #1596546 by applicity_sam, Make sure incorrect month name creates validation error.
-- Issue #1432702, Fix some miscellaneous problems with date example dates and formats.
-- Issue #1512464 by Liam Moreland, Allow for undefined formatter in Date upgrade handling.
-- Issue #1659638 by bojanz, Hide install message if Drupal is not installed (i.e. in install profiles).
-- Issue #1605158 by covenantd, Be sure value2 is initiated in Date Context handler.
-- Issue #1355256 by barraponto develCuy and KarenS, set default value for date text widget increment to 1, and update existing fields.
-- Issue #1561306 by Cyberwolf, Date pager replacement was not working correctly when used with multiple dates.
-- Issue #1541740 by hass, Make Date requirements more easily translatable.
-- Issue #1543524 by iamEAP, Add update hook to remove the D6 date_timezone field from users.
-- Issue #1603640 by bevan, Don't return anything for empty date interval.
-- Issue #1235508, Make sure that ISO strings with '00' in the month and/or day don't create dates for the previous month and day.
-- Issue #1289270 by pdrake: Fixed date arguments and filters do not work with relationships.
-- Issue #895760 by Reinette: Added RFC2447 option 'STATUS' to date_api_ical().inc.
-- Issue #606658 by johnmunro and KarenS, Make sure ical import processes multi-day all-day events correctly.
-- Issue #1408216 follow up, Need to be sure that NULL is the default state for the sql functions.
-- Issue #1540410, Update the Date Tools calendar creation wizard to use the new calendar path.
+Date 7.x-2.11-beta3, 2019-09-22
+-------------------------------
+#1392472 by Taran2L, jvandooren, podarok, jeff h, FluxSauce, maen, solotandem,
+ nickonom, anrikun, JvE, steinmb, joelpittet: Undefined index: timezone in
+ date.field.inc.
+#3022378 by dev11235, DamienMcKenna, joelpittet: Date with empty "Repeats #
+ Weeks" and "Repeats Every # of Days" validation needed.
+#2769057 by id.medion, Chris Matthews, steinmb: Remove unused argument in the
+ function calls field_cache_clear() and field_info_cache_clear(),
+#3033104 by DamienMcKenna: Add a LICENSE.txt file.
+#3032391 by herved, steinmb, skylord, DanielVeza: Empty date fields are being
+ displayed.
+#3033022 by solotandem, steinmb: Correct reference to granularity setting.
+#2701545 by ron_s, Chris Charlton, Chris Matthews, adci_contributor,
+ DamienMcKenna: Add support for Date Popup Timepicker module.
+#3081547 by bhaskar-chakraborty, DamienMcKenna, vijaycs85: Update 7006 breaks
+ when using the field_encrypt module.
+#3032835 by solotandem, DamienMcKenna, steinmb, John_B: Validate input to date
+ filter handler.
-======================
-Version 7.x-2.5
-======================
-- Fix nasty errors on views that have no row indexes, like the frontage view.
+Date 7.x-2.11-beta2, 2018-10-26
+-------------------------------
+#3009740 by evgeny.chernyavskiy, DamienMcKenna, steinmb: PHP 7.3 compatibility,
+ swtich-continue.
+#1267434 by Ronino, DamienMcKenna, kingandy: Default value for #date_items
+ should be an array in date_field_widget_form().
+#2706965 by DamienMcKenna, arulraj, joelstein: Getting browser autocomplete for
+ date pop fields.
+Reverted #2123039.
+#3010076 by DamienMcKenna, steinmb: Improve coding standards in Date module.
+#3012729 by joseph.olstad, lazzyvn: Bad variable $elent.
+#2843367 by artem0793, Liam Morland, azovsky: String Offset errors on edit page
+ using PHP 7.1.0.
+#2447277 by SebCorbin, steinmb: Performance: replace sylesheets[all][] with
+ attached.
+#2990189 by solotandem, jacob.embree, theaxe, sonnykt: Illegal string offset
+ 'value' in date_combo_element_process.
+#2792385 by binoli.addweb, brunodbo, pingwin4eg, joelpittet, DamienMcKenna:
+ Include project namespace in dependency declaration.
+#1138210 by djdevin, kyoder, coltrane, cafuego, JvE: date_sql_handler
+ STR_TO_DATE math incorrect.
+#1415210 by jgullstr, nmudgal, ohthehugemanatee, djdevin, asirjacques,
+ christine1126, steinmb, cydharttha, Jelle_S: Date popup calender doesn't
+ popup when reach to text-field via tab.
+#2894759 by DamienMcKenna, Mansi.AddWeb, hiramanpatil,
+ Michael_Lessard_micles.biz, steinmb: (All Day) : the parantheses are
+ hardcoded.
+#2703401 by jacob.embree, le72, Chris2: Bad assumption about year range format
+ in date_devel_generate().
-======================
-Version 7.x-2.4
-======================
-- Issue #1534342 by bass, Make name of clean pager option easier to translate.
-- Add a hook to alter the default date for a Date argument.
-- Issue #1531904, Make sure that multiple value dates that have the delta set only display the selected value.
-- Revert Issue #1266688 by fago, This change broke Entity token support.
+Date 7.x-2.11-beta1, 2018-10-26
+-------------------------------
+#2937071 by DamienMcKenna: Tidy up the CHANGELOG.txt file.
+#2514146 by ram4nd: Remove the .gitignore file.
+#2533080 by jribeiro, DamienMcKenna, rajeev_drupal, badjava: 'clone' is a
+ reserved keyword introduced in PHP version 5.0 and cannot be invoked as a
+ function.
+#2843367 by RemyAroundTown, alesr, joelpittet, DamienMcKenna, oadaeh,
+ ikeigenwijs, johnzzon, Novitsh, matthiasm11, glynster, robertgarrigos,
+ dchatry, szeidler, Majdi, Plazik, NancyDru, nanobyt3: String Offset errors on
+ edit page using PHP 7.1.0.
+#2889636 by MustangGB, ikeigenwijs, Stevel: Fix PHP 7 tests.
+#2503807 by DamienMcKenna: Date Pager position has no effect after updating to
+ Views 3.11.
+#2995679 by Liam Morland, joseph.olstad: PHP 7.1 no longer converts string to
+ arrays the first time a value is assigned with square bracket notation.
+#2889759 by ladybug_3777: Exposed Date Filter - PHP 7 Error.
+#2449261 by daniel_j, pcho, joseph.olstad, David Hernández, collinhaines,
+ vinmassaro, SkyNet Costa Rica: expects an array, not a scalar - Fatal error:
+ Cannot create references to/from string offsets.
+#1741062 by kim.pepper: The merge method of DateObject class has a wrong
+ parameter type.
+#2873415 by Squee3P0, jcisio, rujinxero, digitaltodd, fdverwoerd, Stray14: PHP
+ 5.3 - Date field being flagged as Invalid date not actually invalid.
+#2902829 by JayKandari, tucho, nileshlohar, matthiasm11, mr.york, kmonty:
+ Formatter settings for Custom date type is not getting saved.
+#2208769 by Cracu, bunthorne, jeni_dc, Proteo, Reis Quarteu, echoz: Theme hook
+ not found while managing date field.
+#3002449 by plach: Timezone rendered when theming date formats without time.
+#2123039 by Gold, hgoto, DamienMcKenna: Add Entity API as a new test dependency.
+#2123039 by Gold, hgoto, DamienMcKenna, RoSk0, Juterpillar, joachim: Default
+ timezone setting mismatch in metadata wrapper integration.
+#2323857 by anpolimus, DamienMcKenna, claudiu.cristea, catch, joelpittet:
+ date_field_schema() has no index on date.
+#2016787 by r-mo, DamienMcKenna, joep.hendrix, heddn, julien_g: Change date
+ fields to "big" int values to avoid "PDOException 22003" errors.
+#1137062 by El Alemaño, Nelson Lago, bjcooper, ron_s, ronnienorwood, lunazoid,
+ Michael_Lessard_micles.biz, DamienMcKenna, vinmassaro: Follow-up to fix
+ regression on week calculations.
+#1177198 by tim.plunkett, DamienMcKenna, MustangGB, arlinsandbulte, KarenS:
+ Allow CTools to process #dependency for date elements.
+#1778220 by hswong3i, kpyan8s, jacob.embree: Remove version from
+ date_migrate_example.info for better git_deploy integration.
+#2880395 by DamienMcKenna, jojonaloha, GoZ: Fatal error: DateTimeZone could not
+ be converted to string.
+#2100851 by Juterpillar, Drupa1ish, RoSk0, pingwin4eg, acbramley: Date views
+ exposed filter causes SQL error on PostgreSQL.
+#2453445 by DamienMcKenna, dan3h, rahul.nahar001: PDOException not handled when
+ using PostgreSQL without timezone support.
+#2204713 by BR0kEN, jstoller, ebeyrent, gaurav.goyal: Undefined index
+ #default_value in date_select_element_process.
+#2291271 by emek, LoonyLuna, periksson: Datepicker needs dynamic width.
+#2851020 by jacob.embree, nileshlohar, AshwiniPatil, rahul.nahar001,
+ Pranjal.addweb, DamienMcKenna, darshanchoudhary: Use of uppercase for PHP
+ constants.
+#2832257 by danuddara, alexbarrett: Typo error - "The upcoming date less then 1
+ day" - date.theme.
+#2844948 by jiv_e: Notice: Undefined index: tz in date_ical_date().
+#1882432 by DamienMcKenna, lolandese: Improve the module'\''s README.txt files.
+#346752 by rreiss, DamienMcKenna: RTL support.
-======================
-Version 7.x-2.3
-======================
-- Issue #1444804, Remove html placeholder on text widget.
-- Issue #1286230, Clean up date pager documentation, it contains deprecated information.
-- Issue #1469020, Make sure page not found is working right for dates outside the specified range.
-- Issue #1111626, Fix some problems caused by passing in a date string with an offset.
-- Issue #1477860, Avoid undefined index errors in date_views_select_validate().
-- Issue #1469038, Add some clarity to the BYDAY description options and make sure a valid value is selected.
-- Issue #1405364 by snufkin, Add display options to format_interval to match Views interval options.
-- Issue #1266688 by linclark, Add microdata support to Date metadata.
-- Issue #1509434 by casey, Add timezone info in hook_field_presave() instead of hook_field_insert() and hook_field_update().
-- Issue #1509012, Fix fatal error when viewing repeat tab.
-- Issue #1037174 by dealancer, More work to allow ajax to work on other widgets.
-- Issue #1473592 by zabelc, Make sure migrated date with missing end date still gets imported correctly.
-- Issue #1442718 by jastraat and bones, Make sure show end date checkbox does not display when end date is empty.
-- Issue #1504556, Fix invalid access permission name in Date API configuration menu.
-- Issue #1484458, Vega timepicker code was incorrectly computing the default date because of the wrong format for the value passed to it.
-- Issue #1459668, Add back Remove date_field_get_sql_handler() function temporarily since Signup module is still using it. Mark it deprecated.
-- Issue #1478296, Display longer abbreviations for day names in date repeat widget so they can be translated.
-- Issue #1488662 by martin.heidegger, Make error message more easily translatable.
-- Issue #1478848 by onelittleant, Don't set default values on new translation entities.
-- Issue #1360672, Fix limit format code to remove leftover non-ascii text as well as leftover ascii text.
-- Issue #1464280 by geerlingguy Georgique and dealancer: Fix notice when using exposed between filter.
-- Issue #1484640 by onelittleant, Some entities may not have base tables.
-- Issue #1472966, Get rid of notice that appears for entities without repeats.
-- Move pager css around. Some code in Calendar and Date API belongs in Date Views.
-- Fix Date Popup default format which was ending up using 24 hour time no matter what format was used for short format.
-- Remove outdated _repeat widget name from Date Tools.
-- Date Tools is defaulting to creating a calendar even if Calendar module is not enabled.
-- Issue #1472148 by arlinsandbulte: wvega jQuery time-picker doesn't show scrollbar.
-- Issue #1392128 by kidrobot, tim.plunkett, willvincent: Fixed Repeats tab shows on nodes with non-repeating dates.
-- Issue #1452882 by coredumperror: Fixed Date Migrate Example doesn't deregister it's migration when disabled.
-- Issue #1452408 by reglogge: Fixed Trailing dots are removed from date formats even if they are needed for the format.
-- Issue #1285260 by Steven Jones: Fixed 'Starting from' display option.
-- Issue #1467244 by bluetegu: Fixed Recurring Sunday errors.
-- Issue #1442718, Empty default values were getting populated by the code that tried to fix default values on hidden fields.
-- Make sure date_handler->placeholders gets initialized even for queries that don't execute so the pager won't throw an exception if the value is missing.
+Date 7.x-2.10, 2017-04-07
+-------------------------
+#1037150 by raggax2, vishy_singhal, >antroxim, Risse: date_popup element with
+ just time doesn't work.
+#2648114 by tsapenkoum: DateTime::format(): The DateTime object has not been
+ correctly initialized by its constructor in DateObject->format().
+#2780415 by prince_zyxware, DamienMcKenna: As per Drupal coding standards, use
+ uppercase for PHP constants.
+#2646646 by anpolimus, Stevel, DamienMcKenna: Tests are broken on current
+ 7.x-2.x branch.
+#2412049 by Stevel: DateMigrateExampleUnitTest fails if migrate is missing
+#2186191 by kaare, jiv_e, DamienMcKenna, welly, PascalAnimateur, lussoluca,
+ mErilainen, vijaycs85, paulwdru, zerolab, joep.hendrix, marc.groth, podarok,
+ pmackay, idebr, jastraat, WorldFallz, autopoietic, streever: Missing help text
+#2377623 by ekli">Gergely Lekli, qzmenko: Remove unnecessary space in data_combo
+ title.
-======================
-Version 7.x-2.2
-======================
-NOTES:
-The iCal templates were removed and moved to the new Date iCal module (http://drupal.org/project/date_ical).
+Date 7.x-2.10-rc1, 2016-04-27
+-----------------------------
+#1355256 by develCuy, barraponto, KarenS, jgullstr, Romash: date field minutes
+ and seconds rounding after update/save.
+#1889744 by tatyana, mstrelan, mariagwyn: PDOException when saving date as unix
+ timestamp.
+#1504202 by seanB, steinmb: Allow entering of custom date format in Views field
+ handlers.
+#2532636 by jstoller: Undefined index: #default_value in
+ date_popup_process_time_part().
+#1699312 by gmclelland, pounard, Niklas Fiekas, azinck, netlooker: Fatal error:
+ Call to undefined function date_field_widget_settings_form_validate() in
+ form.inc.
+#1874422 by danwonac, bluetegu, SeanA, rv0, brockfanning: Pager may cause
+ incorrect "prev" or "next" link.
+#2038057 by vijaycs85, djdevin, pivanov: date_select element's default value as
+ an array raises a warning.
+#2026545 by mistermoper, Jon Nunan: Date field's interval formatter always uses
+ start date.
+#2331975 by BarisW, StryKaizer: Sync end date for the date popup functionality.
+#2339119 by maximpodorov, darkdim: Notice: Undefined index: date in
+ date_text_element_process().
+#2570239 by PascalAnimateur: Display date range as span instead of div
+#2611968 by FluxSauce: PHP Fatal error: Class 'MigrateFieldHandler' not found
+#2160843 by ohokare">nupur.lohokare: Grammar issue: "Date objects can be created
+ and cached as date fields are loaded rather than when they are displayed to
+ improve performance".
-- Issue #1423364 by emptyvoid, Move Date context plugin into its own file.
-- Issue #1447372 by yched, Memory friendlier version of date_repeat_field_bundles().
-- Issue #1447140 by tim.plunkett: Remove iCal-related theme functions/files.
-- Issue #1284170 by benjifisher, Lots of cleanup of the iCal export and its template to be sure all day items are exported correctly.
-- Issue #1346424, The calendar title got left out of the latest ical template changes.
-- Add more information to the date_views_base_tables() function about why we can't use the entity type from views_fetch_data().
-- Additional handling is needed so that revisions are handled correctly in Views.
-- Remove date_field_get_sql_handler() function which isn't being used anywhere.
-- Rework the Date Views hooks that queue up the right fields and base tables so they work better across all types of entities.
-- Fix the hooks for file tables, it is file_managed, not files.
-- Add a helper function to map entity types to Views base tables to make it easier to know what type of entity is being used on a view.
-- Add status information to Date help screen, hide the non-working change tab on the Date Tools screen, and remove some code that goes to the calendar module from Date Tools.
-======================
-Version 7.x-2.1
-======================
+Date 7.x-2.10-beta1, 2016-01-08
+-------------------------------
+#2325207 by jojonaloha, v1nk, podarok: DateTimeZone could not be converted to
+ string.
+#2469189 by TommyK: Notice: Undefined index: show_remaining_days in
+ date_field_formatter_view() (line 210 of …/date/date.field.inc).
+#1854220 by ryanissamson, paravibe: Add module_exists so that error isn't thrown
+ when disabling date_repeat_field module.
+#2375235 by Lostboy22, steinmb, rsmylski, Jelle_S: Calendar block Next/Prev
+ navigation broken.
+#1889744 by tatyana, mstrelan, mariagwyn: PDOException when saving date as unix
+ timestamp.
+#1797630 by damiankloip, webby7097, Fabianx: 'Is empty(null)' views filter is
+ not working with exposed operators enabled when actual date values are left
+ empty.
-- Issue #1437242 by zerbash, Remove extraneous leading slashes in module_load_include().
-- Issue #1436722 by hefox: Fixed Undefined variable $form_set_error() used as function.
-- Issue #1250626 by Gábor Hojtsy, B-Prod, hefox: Added start date and end date labels.
-- Issue #1253482, Make sure $argument->is_default gets reset by the Date pager when altering results.
-- Adjust Date Tools to work with changes to use Views templates to create calendars.
-- Issue #1398584 by dhalbert and , Make sure groupby times is initialized.
-- Issue #1394248, Make sure all date parts are selected when using an exposed select filter.
-- Issue #1425774 by sgabe, Fix error in exposed filter, array_filter() -- first argument should be an array in date_select_input_date().
-- Issue #1432992 by bart.hanssens, Fix typo in php documentation.
-- Issue #323852 by tim.plunkett and arlinsandbulte, Dropdowns shouldn't include a blank option when required.
-- Issue #323852, Validation was broken for unlimited value select widgets with required dates, they were incorrectly getting their end dates cleared out.
-- Issue #1424656 by tim.plunkett, Unify signature and alters of #process callbacks.
-- Issue #1408014 by dasjo, We no longer need the $error_element value to display errors properly, second follow-up.
-- Issue #1299030 by Vincent B: Ensure that 'To Date' is properly marked when required.
-======================
-Version 7.x-2.0-rc2
-======================
+Date 7.x-2.9, 2015-09-08
+------------------------
+#2072679 by leewillis77: SQLSTATE[42S22] error and no results when multiple
+ dates included in views filter.
+#2503315 by CptCasual: Fatal error: Cannot unset string offsets in
+ date_elements.inc.
+#2543442 by dawehner: Expose site-wide date input format in the UI.
+#1993110 by Hanno, tsyvs, Valentine94: field type not translatable.
+#1675844 by mpdonadio, justin2pin, paravibe, Valentine94: The "Repeat" checkbox
+ does not open / close the correct fieldset in some circumstances.
-New Features/Major Changes
-- Issue #1358790 by tim.plunkett and redndahead, Store date objects in field_load to speed up processing, with a field setting option to control it.
+Date 7.x-2.9-rc1, 2015-03-27
+----------------------------
+#2199587 by oadaeh, jmuzz: Second validation of date popup causes error.
+#2374287 by vijaycs85, herd45: Error messageNotice: Undefined index: value in
+ date_views_select_validate.
+#2420323 by Michelle: Exposed date filter shouldn't automatically set a default
+ date if none requested.
+#1437892 by stefan.r, interdruper: Undefined index notices in date_popup.module
+ and default values disappear.
+#2372073 by vijaycs85, Lostboy22, maximpodorov, stefan.r: Undefined variable:
+ granularity in date_views_plugin_pager->query() (line 285 of date_views
+ /includes/date_views_plugin_pager.inc.
+#2451027 by Chewie, stBorchert: Migrate module: undefined index timezone error.
+#206127 by TravisCarden, BenPoole, dwightaspinwall, nerdcore, georgir: Add
+ ability to sort Views exposed filters SELECT lists in reverse.
+#2235393 by Pere Orga, andrdrx: CSS pseudoselector 'ends with' should not be
+ used with the class attribute.
+#1078788 by jacob.embree, mgifford: Coder issues in Date.
+#1137062 by Sylvain Lecoy, schifazl, hughworm: date_week_range and
+ date_iso_week_range both returns 1 day too much.
+
+
+Date 7.x-2.9-beta2, 2014-12-04
+------------------------------
+#1166036 by andriyun | Palmeus: Showing the remaining days until event.
+#2359673 by korgik: Fixed Wrong condition in removeGranularity method.
+#2375605 by cosmicdreams, ssdas: When configured to use Date's timezone and
+ using a muti-value date field, I expect each date field to remember the
+ timezone that was set.
+#2371471 by schifazl, anrikun, esomething, MXT, maximpodorov, alayham,
+ Lostboy22, k.skarlatos: Error with entity_metadata_wrapper for Date Field with
+ Start But No End.
+#2332181 by bneil, cafuego: Add update hook for date_views variables.
+
+
+Date 7.x-2.9-beta1, 2014-11-08
+-------------------------------
+#2366199 by vlad.dancer: Sniffer fixes.
+#2325425 by catch: Fixed Trim input dates in date_popup.
+#2238135 by Valentine94, cs_shadow, e5sego: Fixed 0 (zero) time value will be
+ rejected.
+#2277107 by LinL: Fixed Date API's Status report entry repeats the word "to".
+#2367791 by sergiuteaca: Fixed Extra white space before full stop on Repeat
+ title.
+#2367779 by andreyks, sanchiz: Fixed Regression in date_popup.js after code
+ cleanup.
+#1246940 by yingtho, andreyks | acbramley: Added more custom formats for Date
+ Popup.
+#1909566 by Valentine94, Ronino: Fixed Devel generate fails for date fields
+ with absolute years in ranges.
+#1997774 by Valentine94, ryan.armstrong, haggins: Added Update Time Entry plugin
+ to 1.5.2.
+#2369691 by sanchiz: Code standarts in date.theme.
+#1487700 by Valentine94, Jorrit, El Alemaño | casey: Added Views date pager,
+ option to skip empty pages.
+#1878970 by Elijah Lynn, Valentine94: Fixed Entering 4 digit year manually.
+ Extra spacing at beginning/end is not trimmed, results in validation error.
+#2279831 by itarato: Fixed Date field validation breaks if it's coming from a
+ Panels visibility rule.
+#1467712 by ankur_novatree, anrikun, jmonkfish, fledev, MustangGB, DuaelFr,
+ jibran, l0coful: Added Make it possible to disable fieldset for date field.
+#2026811 by kala4ek, forgenator: Fixed Views argument in contextual filter
+ doesn't have all granularity options.
+#2367595 by jbubik: Fixed 'r' formatter produces RFC2822-incompliant results in
+ non-English environment.
+#2361671 by mfernea: Fixed Notice returned in
+ date_default_formatter_settings_summary when using custom settings.
+#1885270 by Eduardo Alvarez, mareksal, JvE | haffmans: Fixed UTC time zone
+ handling shows UTC, not converted, date/time.
+
+
+Date 7.x-2.9-alpha2, 2014-09-24
+-------------------------------
+#2309015 by msankhala, Temoor: Fixed views date field exposed filter default
+ value not being added in $form_state['input'] when initially views loads.
+#2323191 by guillaumev: Fixed Issue with testing.
+#2313587 by BWPanda: Fixed Incorrect permission name.
+
+
+Date 7.x-2.9-alpha1, 2014-07-31
+-------------------------------
+#2294973 by lsabug, micahw156, keesje: Fixed Date format in calendar title
+ remains default.
+
+
+Date 7.x-2.8, 2014-07-29
+------------------------
+#106713 by vijaycs85, heddn: Date Field title XSS(SA).
+#2310123 by Temoor: Fixed Fatal error in Migrate UI by Date Migrate Example.
+#2142277 by Temoor, lliss: Fixed Infinite Loop When Using Repeating Dates.
+#1871136 by Temoor, funkimunky: Fixed Cannot remove migrate example content
+ type.
+#2261395 by minorOffense, kristofferwiklund: Fixed date_now is not respecting
+ changes to timezone.
+#1832400 by imot3k, balintk: Fixed "The year/month/... is missing" error message
+ is not translatable.
+#998076 by coredumperror, joelcollinsdc, brenk28: Fixed Problem with timezone
+ handling (caused by date_get_timezone_db returning only UTC).
+#1976014 by Harmageddon: Remove unnecessary in date views pager.
+#2198807 by stickywes: Refactor field tests to utilize DateFieldTestBase.
+#2146461 by vijaycs85, Razia_b: Fixed Translated field's label is not used in
+ its validation messages.
+#1874422 by bluetegu, brockfanning, rv0: Fixed Week pager may cause incorrect
+ "next" link on year change.
+#2167015 by schifazl: HTML output breaks validation and accessibility.
+#2200513 by scor: Fix encoding issues in CHANGELOG.txt.
+#2115377 by coredumperror: Notice: Undefined index: add_microdata in
+ theme_date_display_single().
+#2178299 by sandykadam, joachim: Incorrect variable name in
+ hook_views_data_alter().
+#1431952 by Cadila, Shawn DeArmond: Date field will only set in Rules if it
+ already has a value.
+#355058 by Grimreaper, prunelle: Hardcoded day/month/week output format for
+ theme_date_nav_title().
+#1968828 by pjcdawkins: Replace field_info_fields() with field_info_field_map()
+ for Drupal >= 7.22.
+#2167033 by podarok, vijaycs85: Fixing tests in 2014.
+
+
+Date 7.x-2.7, 2013-12-21
+------------------------
+#1691342 by Cyberwolf: Field description is displayed multiple times.
+#1668240 by ianthomas_uk: /themes/jquery.timeentry.css is not aggregated with
+ other CSS files.
+#1974056 by pjcdawkins: Add a CSS class to the date repeat rule.
+#2065749 by vijaycs85, blackdog: $class in theme_date_repeat_rrule is not used.
+#1840008 by cr0ss, Alan D: Unlock "Date attributes" (granularity) field setting.
+#1580032 by jmuzz, 30equals: Date values are not being saved when field is used
+ in a nested field collection.
+#2071629 by blackdog: #after_build wrongly added, overwrites other modules.
+#1869962 by kaidjohnson: Date Context breaks context edit form.
+#1571258 by David_Rothstein, ddalvi: Date and time form elements do not have
+ accessible labels when the label position is set to 'Within' or 'None'.
+#2130575 by kostajh: Unset() should be used with more caution in
+ views_filter_handler_simple().inc.
+#1826598 by eromba, jyee: 'c' and 'r' formatter causes date to be printed twice
+ in views.
+#1933472 by minorOffense: Added Optimize date_now() function.
+#1248786 by kenneth.venken, dboulet: Fixed appearance of marker for required
+ date fields.
+#1810734 by ParisLiakos: Fixed Repeat checkboxes working reversed with updated
+ jQuery.
+#1844092 by dboulet, kardave, Spleshka: Fixed Untranslated strings: month, day,
+ ...
+#1202248 by james.williams, dawehner, mikehues, DamienMcKenna: Fixed Exported
+ view doesn't include 'default_argument_options()' attribute.
+#1409120 by anrikun, akamustang, marsbidon: Added Date format in views exposed
+ filter does not respect configured format.
+#1858112 by tomdearden: Fixed DateObject->difference not calculating correctly
+ for future dates > 1 year away.
+#1659466 by artkon: Fixed Date filter does not remember value in views if the
+ identifier is something other than date_filter().
+#1905096 by gielfeldt: Fixed Wrong usage of database API.
+#1791804 by 5n00py: Errors on form validation if date field placed in sub-form.
+#636208 by KarenS: Date range: Expose a single filter to select events that
+ start before the chosen date and end after the chosen date by anrikun.
+#2024269 by KarenS: Date popup documentation fix by RoySegall.
+#1835184 by Steven Jones, das-peter, jwhat: Fixed date_limit_format() can have
+ poor performance.
+#991830 by milesw, restyler: Fixed validation errors when date_popup() date is
+ localized.
+#2098715 by jhodgdon: Fixed Date field not obeying widget alters for #required.
+#1266688 by linclark, rbayliss, fago, colette: Support microdata in date fields.
+#1863610 by maximpodorov: Fixed Invalid date formatting.
+#2034231/#1832544 by mikeryan: Class registration for Migrate 2.5 or later.
+#1835214 by PatchRanger: Automated tests failing - Exception thrown in Date2
+ migration.
+#1350604 by Alan D., johaziel: Added Diff support for Date fields.
+#2086313 by dooug: Fixed Wrong path in date_popup() README.txt
+#1455558 by BTMash, mediameriquat: Fixed Missing file in date_views().info
+ causes error 500.
+#1697322 by Alan D., ianmthomasuk, pandikamal: Fixed Call to a member function
+ getName() on a non-object in date api.
+By KarenS: Code cleanup, remove #prev values that were never used in repeat
+ functionality.
+By KarenS: Small fix needed to ensure cardinality gets set correctly if repeat
+ option is changed in the UI.
+
+
+Date 7.x-2.6, 2012-08-13
+------------------------
+#1423364 by catmat: Add file and path to hook_context_plugins().
+#1713248 by KarenS: Remove incorrect use of date_popup() function in previous
+ commit.
+#1143680 by kristiaanvandeneynde: Make Date Popup widget able to accept custom
+ settings.
+#1596546 by applicity_sam: Make sure incorrect month name creates validation
+ error.
+#1432702 by KarenS: Fix some miscellaneous problems with date example dates and
+ formats.
+#1512464 by Liam Moreland: Allow for undefined formatter in Date upgrade
+ handling.
+#1659638 by bojanz: Hide install message if Drupal is not installed (i.e. in
+ install profiles).
+#1605158 by covenantd: Be sure value2 is initiated in Date Context handler.
+#1355256 by barraponto, develCuy, KarenS: Set default value for date text
+ widget increment to 1, and update existing fields.
+#1561306 by Cyberwolf: Date pager replacement was not working correctly when
+ used with multiple dates.
+#1541740 by hass: Make Date requirements more easily translatable.
+#1543524 by iamEAP: Add update hook to remove the D6 date_timezone field from
+ users.
+#1603640 by bevan: Don't return anything for empty date interval.
+#1235508 by KarenS: Make sure that ISO strings with '00' in the month and/or day
+ don't create dates for the previous month and day.
+#1289270 by pdrake: Fixed date arguments and filters do not work with
+ relationships.
+#895760 by Reinette: Added RFC2447 option 'STATUS' to date_api_ical().inc.
+#606658 by johnmunro, KarenS, Make sure ical import processes multi-day all-day
+ events correctly.
+#1408216 by KarenS: Need to be sure that NULL is the default state for the SQL
+ functions.
+#1540410 by KarenS: Update the Date Tools calendar creation wizard to use the
+ new calendar path.
+
+
+Date 7.x-2.5, 2012-04-19
+------------------------
+By KarenS: Fix nasty errors on views that have no row indexes, like the frontage
+ view.
+
+
+Date 7.x-2.4, 2012-04-19
+------------------------
+#1534342 by bass: Make name of clean pager option easier to translate.
+By KarenS: Add a hook to alter the default date for a Date argument.
+#1531904 by KarenS: Make sure that multiple value dates that have the delta set
+ only display the selected value.
+Revert Issue #1266688 by fago, This change broke Entity token support.
+
+
+Date 7.x-2.3, 2012-04-01
+-------------------------------
+#1444804: Remove html placeholder on text widget.
+#1286230: Clean up date pager documentation, it contains deprecated information.
+#1469020: Make sure page not found is working right for dates outside the
+ specified range.
+#1111626: Fix some problems caused by passing in a date string with an offset.
+#1477860: Avoid undefined index errors in date_views_select_validate().
+#1469038: Add some clarity to the BYDAY description options and make sure a
+ valid value is selected.
+#1405364 by snufkin: Add display options to format_interval to match Views
+ interval options.
+#1266688 by linclark: Add microdata support to Date metadata.
+#1509434 by casey: Add timezone info in hook_field_presave() instead of
+ hook_field_insert() and hook_field_update().
+#1509012, Fix fatal error when viewing repeat tab.
+#1037174 by dealancer: More work to allow ajax to work on other widgets.
+#1473592 by zabelc: Make sure migrated date with missing end date still gets
+ imported correctly.
+#1442718 by jastraat, bones: Make sure show end date checkbox does not display
+ when end date is empty.
+#1504556 by KarenS: Fix invalid access permission name in Date API configuration
+ menu.
+#1484458 by KarenS: Vega timepicker code was incorrectly computing the default
+ date because of the wrong format for the value passed to it.
+#1459668 by KarenS: Add back Remove date_field_get_sql_handler() function
+ temporarily since Signup module is still using it. Mark it deprecated.
+#1478296 by KarenS: Display longer abbreviations for day names in date repeat
+ widget so they can be translated.
+#1488662 by martin.heidegger: Make error message more easily translatable.
+#1478848 by onelittleant: Don't set default values on new translation entities.
+#1360672 by KarenS: Fix limit format code to remove leftover non-ascii text as
+ well as leftover ascii text.
+#1464280 by geerlingguy, Georgique, dealancer: Fix notice when using exposed
+ between filter.
+#1484640 by onelittleant: Some entities may not have base tables.
+#1472966 by KarenS: Get rid of notice that appears for entities without repeats.
+By KarenS: Move pager css around. Some code in Calendar and Date API belongs in
+ Date Views.
+By KarenS: Fix Date Popup default format which was ending up using 24 hour time
+ no matter what format was used for short format.
+By KarenS: Remove outdated _repeat widget name from Date Tools.
+By KarenS: Date Tools is defaulting to creating a calendar even if Calendar
+ module is not enabled.
+#1472148 by arlinsandbulte: wvega jQuery time-picker doesn't show scrollbar.
+#1392128 by kidrobot, tim.plunkett, willvincent: Fixed Repeats tab shows on
+ nodes with non-repeating dates.
+#1452882 by coredumperror: Fixed Date Migrate Example doesn't deregister it's
+ migration when disabled.
+#1452408 by reglogge: Fixed Trailing dots are removed from date formats even if
+ they are needed for the format.
+#1285260 by Steven Jones: Fixed 'Starting from' display option.
+#1467244 by bluetegu: Fixed Recurring Sunday errors.
+#1442718, Empty default values were getting populated by the code that tried to
+ fix default values on hidden fields.
+By KarenS: Make sure date_handler->placeholders gets initialized even for
+ queries that don't execute so the pager won't throw an exception if the value
+ is missing.
+
+
+Date 7.x-2.2, 2012-02-24
+------------------------
+By KarenS: The iCal templates were removed and moved to the new Date iCal module
+ (http://drupal.org/project/date_ical).
+#1423364 by emptyvoid, Move Date context plugin into its own file.
+#1447372 by yched, Memory friendlier version of date_repeat_field_bundles().
+#1447140 by tim.plunkett: Remove iCal-related theme functions/files.
+#1284170 by benjifisher, Lots of cleanup of the iCal export and its template to
+ be sure all day items are exported correctly.
+#1346424, The calendar title got left out of the latest ical template changes.
+By KarenS: Add more information to the date_views_base_tables() function about
+ why we can't use the entity type from views_fetch_data().
+By KarenS: Additional handling is needed so that revisions are handled correctly
+ in Views.
+By KarenS: Remove date_field_get_sql_handler() function which isn't being used
+ anywhere.
+By KarenS: Rework the Date Views hooks that queue up the right fields and base
+ tables so they work better across all types of entities.
+By KarenS: Fix the hooks for file tables, it is file_managed, not files.
+By KarenS: Add a helper function to map entity types to Views base tables to
+ make it easier to know what type of entity is being used on a view.
+By KarenS: Add status information to Date help screen, hide the non-working
+ change tab on the Date Tools screen, and remove some code that goes to the
+ calendar module from Date Tools.
+
+
+Date 7.x-2.1, 2012-02-14
+------------------------
+#1437242 by zerbash, Remove extraneous leading slashes in module_load_include().
+#1436722 by hefox: Fixed Undefined variable $form_set_error() used as function.
+#1250626 by Gábor Hojtsy, B-Prod, hefox: Added start date and end date labels.
+#1253482, Make sure $argument->is_default gets reset by the Date pager when
+ altering results.
+By KarenS: Adjust Date Tools to work with changes to use Views templates to
+ create calendars.
+#1398584 by dhalbert and KarneS, Make sure groupby times is initialized.
+#1394248 by KarenS: Make sure all date parts are selected when using an exposed
+ select filter.
+#1425774 by sgabe: Fix error in exposed filter, array_filter() -- first argument
+ should be an array in date_select_input_date().
+#1432992 by bart.hanssens: Fix typo in php documentation.
+#323852 by tim.plunkett and arlinsandbulte, Dropdowns shouldn't include a blank
+ option when required.
+#323852 by KarenS: Validation was broken for unlimited value select widgets with
+ required dates, they were incorrectly getting their end dates cleared out.
+#1424656 by tim.plunkett: Unify signature and alters of #process callbacks.
+#1408014 by dasjo: We no longer need the $error_element value to display errors
+ properly, second follow-up.
+#1299030 by Vincent B: Ensure that 'To Date' is properly marked when required.
+
+
+Date 7.x-2.0-rc2, 2012-02-01
+----------------------------
+New Features/Major Changes:
+#1358790 by tim.plunkett and redndahead: Store date objects in field_load to
+ speed up processing, with a field setting option to control it.
+
+Bugfixes:
+#1423598 by KarenS: Found a way to flag items that are new so we know when to
+ add default values.
+By KarenS: Made some fixes to find and test the right entities when checking
+ whether to use default values. More work is needed.
+#1422600 by KarenS: Make sure end date cannot cause validation errors when show
+ end date checkbox is not checked.
+#1417872 by KarenS: Remove code to compute missing date parts from empty values
+ now that the new validation prevents that from working.
+#1417872 by KarenS: Make sure empty year field is validated in the same way
+ other date parts are validated.
+By KarenS: Alter date field test to test with a complete end date instead of
+ using empty elements.
+By KarenS: Fix broken logic in repeat additions.
+By KarenS: Fix test broken by date repeat clean up.
+#1419106 by hanoii: Added more info to hook_date_text_process_alter().
+#1209026 by KarenS: When date validation fails, Date Popup value is getting
+ cleared.
+#1017216 by tim.plunkett, arlinsandbulte: Added custom date format without time
+ shows 'all day'.
+#1408014 by dasjo: We no longer need the $error_element value to display errors
+ properly.
+#554546 by master-of-magic: Fix Timezone list translation
+#1411038 by jhodgdon: Fixed Date formatting is not obeying granularity.
+#1359464 by KarenS: Make sure that default values on hidden elements have the
+ same construct as loaded values to avoid errors.
+#1399744 by tim.plunkett: Rework the way filter groups are used to be sure the
+ Date filter group does not clobber the Views filter group.
+#1411862 by KarenS: Move the date_views_fields() function into date_view.module
+ to be sure it is always available.
+#1380350 by KarenS: Rework SQL query handling to pass in a comparison date for
+ computing offsets to better handle dates affected by DST adjustments.
+#1359464 by KarenS: Temporary fix for broken handling of repeating dates on
+ users with a TODO to figure out where it's coming from.
+#1404494 by byrond: Make sure hidden formatters don't get switched to
+ date_default in update hook.
+#1386012 by KarenS: Order weekdays in Date Repeat form to match the site first
+ day of week settings.
+#1376476 by pbfleetwood: Add commas to default formatting of week and day
+ headers.
+#1408430 by KarenS: Views pagination with exposed, unset, filters, results in
+ invalid default values. Treat them as empty input.
+#1408996 by KarenS: Exposed Date Popup widget with time not correctly
+ initialized.
+#1271726 by KarenS: Text widgets in exposed filters used with pagers produce
+ unexpected results.
+#1096000 by KarenS: Custom date formats not working right.
+#1405364 by KarenS: Format interval settings were getting overridden by missing
+ break.
+#1387890 by KarenS: Make sure disabled fields are shown and retain their
+ original values.
+#1402232 by timplunkett: Switch 'Implementation of' to 'Implements'
+#1402236 by timplunkett: All functions should be prefixed with your module name
+ to avoid name clashes
+#1402238 by timplumkett: Remove references to CCK
+#1011624 by KarenS: Filters and arguments were not always using the right base
+ table to select field options, causing 'column missing' errors.
+#1397822 by KarenS: Fix 'Undefined index: field' error on line 207 of
+ date_views_filter_handler_simple.inc.
+#1396536 by KarenS: Repeating fields weren't getting created with Devel Generate
+ because of the change in widgets. Add new hooks so Date Repeat Field can add
+ the repeats.
+#1397126 by arlinsandbulte: Fix broken tests.
+#1397158 by KarenS: The default value for the end date was using the wrong
+ timezone setting.
+#1392128 by kidrobot, tim.plunkett: Don't show repeat tab unless the date is
+ repeating.
+#1397126 by KarenS: Add Date API section to administration menu and consolidate
+ Date Popup and Date Tools settings there.
+By KarenS: Follow up to Issue #1302052 by benjifisher, More clean up of ical
+ line endings.
+#1388174 by travist: Remove redundant use of date_default_timezone().
+#1388586 by Moloc: Don't use check_plain() on system messages with links.
+#1302052 by benjifisher, penguin25, helmo: Fix linespace ending problems in ical
+ files.
+#1357216: The Date Views field list was including the Date Views filter itself,
+ creating errors about missing node.date_filter values.
+#1259870: Reinstate the test for a missing date argument for the pager.
+By KarenS: The new option to hide the add_delta for simple fields needs to be
+ adjusted to work right where there is no field.
+By KarenS: Tweak the all day formula to check for 59:59 even for items that use
+ increments, to help fix problems when the calendar creates all day values.
+By KarenS: Our test for whether this is a Date argument or filter needs to
+ include a check that the field was actually processed by Date Views. Some
+ dates are not.
+By KarenS: Revert the change to 7.8. It breaks the modules page.
+#1379172 by deviantpixel: Note that the Date Repeat form uses a function that
+ was re-named in 7.8.
+By KarenS: Store the locale format in a static cache to avoid re-computing it
+ dozens of times on calendar views.
+By KarenS: Sheesh. Fix syntax error in api.date.php.
+
+
+Date 7.x-2.0-rc1, 2011-12-20
+----------------------------
+The Date Browser has been removed. Please use the Date Pager instead. If you
+have existing views using the Date Browser the navigation will just disappear
+from them. If you add a Date Pager to the view you should get it back. Then
+delete the Date Browser attachment from the view, since it doesn't do anything
+any more.
+
+The UNTIL date was not getting included in repeating results and that is now
+fixed. This is an API change of sorts for anyone who worked around the issue by
+setting it ahead.
+
+The All Day checkbox and All Day themes were moved into a separate module, using
+new hooks added to the date processing. This module should serve as an example
+of how other modules can inject functionality into date fields.
+
+A new module has been added for integrating the Date Repeat API into date
+fields. Some of this code has been moved into the new module, more of it will be
+moved later as I figure out how to unwind it from the base processing. An update
+hook has been added to enable this module by default for existing sites. If you
+don't use Repeating dates you can disable it.
+
+New Features/Major Changes:
+#1229378 by ksenzee: Sync the end date with the start date on new dates using
+ select widgets.
+#1236216 by KarenS: Move the repeating date integration out of the Date module
+ and into a separate, Date Repeat Field module.
+#874322 by KarenS: The All Day functionality has been moved into a separate
+ module and hooks were added to make it easier for other modules to inject
+ steps into date processing.
+#1267046 by KarenS: Include the UNTIL date in repeating results.
+#1354606 by temaruk: Rework the repeating date UI to make it more user-friendly.
+#1362654 by KarenS: Remove Advanced Help integration, it needs a total rewrite.
+#1357362 by KarenS: Remove Date Browser, use Date Pager instead.
+#1354606 by KarenS: Make sure COUNT option without UNTIL date can be handled
+ correctly by repeating date computations.
Bugfixes
+By KarenS: Fix to new default date handling, the default date has to set a date
+ in the database timezone, not the display timezone.
+#1245106 by Gábor Hojtsy, Hide the option to add the delta into the view for
+ single value fields.
+#1370876 by KarenS: Make sure new Date All Day code does not try to set the
+ popup values if Date Popup is disabled.
+#874322 by KarenS: Add back the date_field_all_day() function to avoid breaking
+ other modules that are using it.
+By KarenS: Fix Date text placeholder to display a formatted date instead of a
+ format. Follow up to Date repeat UI changes.
+#1248520 by fearlsgroove, Use attribute selector on all day and end day
+ checkboxes.
+#952446 and #1031690 by KarenS: Select dates with only year and month were not
+ working.
+#1292152 by pfrenssen, Remove debug functions.
+#1338976 by Josh Benner, Adjust iCal unwrap to allow for leading spaces, per
+ standard.
+#1352486 by d.novikov, Rework date SQL formatting for Microsoft SQL.
+#1266536 by KarenS: Keep timezone adjustments from altering the values for
+ repeating date EXCEPTIONS and ADDITIONS.
+#1353488 by KarenS: Some repeating date calculations using PHP 5.3.6+ were not
+ computing correctly.
+#1364026 by KarenS: Fix link to documentation, also move help to Date API
+ module.
+#1276270 by KarenS: Fix fatal error when using repeat date on user.
+#1362758 by KarenS: Add empty file for the date_plugin_display_attachment.inc
+ file that was removed, to avoid fatal errors if it is missing on a site that
+ formerly used it.
+#1363460 by KarenS: Make sure widget dates do not end up with the current date
+ when they should be empty.
+#1353488 by KarenS: Attempt to fix problem using date_date_set() in PHP 5.3.6+.
+By KarenS: Date Migrate tests needed some fixes to conform to latest code.
+#1353790 by KarenS: Hide missing index notice if the value in the Date Popup
+ does not match the expected value, it will still get trapped as a validation
+ error.
+#1353790 by KarenS: Make sure Date Popup properly translates the default value
+ if it includes month or day names.
+#1217796 by KarenS: Make sure that All Day formatting works correctly even if
+ the All Day label is empty.
+By KarenS: The repeat description was lost by a recent change to the theme that
+ sent the element through the theme twice.
+By KarenS: Remove date_get_nested_elements() function. Not being used and I
+ don't want other code to start expecting it.
+#1266144 by KarenS: The end date should get set to blank if it is optional and
+ matches the start date, but only if it is not populated by default values.
+#1349510 by KarenS: Make sure default values get populated before processing so
+ they still get set on hidden fields.
-- Issue #1423598, Found a way to flag items that are new so we know when to add default values.
-- Made some fixes to find and test the right entities when checking whether to use default values. More work is needed.
-- Issue #1422600, Make sure end date cannot cause validation errors when show end date checkbox is not checked.
-- Issue #1417872, Remove code to compute missing date parts from empty values now that the new validation prevents that from working.
-- Issue #1417872, Make sure empty year field is validated in the same way other date parts are validated.
-- Alter date field test to test with a complete end date instead of using empty elements.
-- Fix broken logic in repeat additions.
-- Fix test broken by date repeat clean up.
-- Issue #1419106 by hanoii: Added more info to hook_date_text_process_alter().
-- Issue #1209026, When date validation fails, Date Popup value is getting cleared.
-- Issue #1017216 by tim.plunkett, arlinsandbulte: Added custom date format without time shows 'all day'.
-- Issue #1408014 by dasjo, We no longer need the $error_element value to display errors properly.
-- Issue #554546 by master-of-magic: Fix Timezone list translation
-- Issue #1411038 by jhodgdon: Fixed Date formatting is not obeying granularity.
-- Issue #1359464, Make sure that default values on hidden elements have the same construct as loaded values to avoid errors.
-- Issue #1399744 by tim.plunkett, Rework the way filter groups are used to be sure the Date filter group does not clobber the Views filter group.
-- Issue #1411862, Move the date_views_fields() function into date_view.module to be sure it is always available.
-- Issue #1380350, Rework SQL query handling to pass in a comparison date for computing offsets to better handle dates affected by DST adjustments.
-- Issue #1359464, Temporary fix for broken handling of repeating dates on users with a TODO to figure out where it's coming from.
-- Issue #1404494 by byrond, Make sure hidden formatters don't get switched to date_default in update hook.
-- Issue #1386012, Order weekdays in Date Repeat form to match the site first day of week settings.
-- Issue #1376476 by pbfleetwood, Add commas to default formatting of week and day headers.
-- Issue #1408430, Views pagination with exposed, unset, filters, results in invalid default values. Treat them as empty input.
-- Issue #1408996, Exposed Date Popup widget with time not correctly initialized.
-- Issue #1271726, Text widgets in exposed filters used with pagers produce unexpected results.
-- Issue #1096000, Custom date formats not working right.
-- Issue #1405364, Format interval settings were getting overridden by missing break.
-- Issue #1387890, Make sure disabled fields are shown and retain their original values.
-- Issue #1402232 by timplunkett, Switch 'Implementation of' to 'Implements'
-- Issue #1402236 by timplunkett, All functions should be prefixed with your module name to avoid name clashes
-- Issue #1402238 by timplumkett, Remove references to CCK
-- Issue #1011624, Filters and arguments were not always using the right base table to select field options, causing 'column missing' errors.
-- Issue #1397822, Fix 'Undefined index: field' error on line 207 of date_views_filter_handler_simple.inc.
-- Issue #1396536, Repeating fields weren't getting created with Devel Generate because of the change in widgets. Add new hooks so Date Repeat Field can add the repeats.
-- Issue #1397126 follow-up by arlinsandbulte, Fix broken tests.
-- Issue #1397158, The default value for the end date was using the wrong timezone setting.
-- Issue #1392128 by kidrobot and tim.plunkett, Don't show repeat tab unless the date is repeating.
-- Issue #1397126, Add Date API section to administration menu and consolidate Date Popup and Date Tools settings there.
-- Follow up to Issue #1302052 by benjifisher, More clean up of ical line endings.
-- Issue #1388174 by travist, Remove redundant use of date_default_timezone().
-- Issue #1388586 by Moloc, Don't use check_plain() on system messages with links.
-- Issue #1302052 by benjifisher, penguin25, and helmo, Fix linespace ending problems in ical files.
-- Issue #1357216, The Date Views field list was including the Date Views filter itself, creating errors about missing node.date_filter values.
-- Issue #1259870, Reinstate the test for a missing date argument for the pager.
-- The new option to hide the add_delta for simple fields needs to be adjusted to work right where there is no field.
-- Tweak the all day formula to check for 59:59 even for items that use increments, to help fix problems when the calendar creates all day values.
-- Our test for whether this is a Date argument or filter needs to include a check that the field was actually processed by Date Views. Some dates are not.
-- Revert the change to 7.8. It breaks the modules page.
-- Issue #1379172 by deviantpixel, Note that the Date Repeat form uses a function that was re-named in 7.8.
-- Store the locale format in a static cache to avoid re-computing it dozens of times on calendar views.
-- Sheesh. Fix syntax error in api.date.php.
-======================
-Version 7.x-2.0-rc1
-======================
+Date 7.x-2.0-alpha5, 2011-11-29
+-------------------------------
+The date repeat widgets have been removed to keep users from trying to change
+repeating dates into non-repeating dates. There are now just three widgets, Date
+Select, Date Text, and Date Popup. Whether or not a date is a repeating date is
+now controlled by a field setting.
-Notes:
-The Date Browser has been removed. Please use the Date Pager instead. If you have existing views using the Date
-Browser the navigation will just disappear from them. If you add a Date Pager to the view you should get it back.
-Then delete the Date Browser attachment from the view, since it doesn't do anything any more.
+New Features/UX Changes/API Changes:
+#1304056 by DamienMcKenna: Add option to date_difference to indicate direction
+ of difference.
+#1238660 by KarenS: Add custom format option for the date format used in summary
+ arguments.
+#1038482 by somanyfish, iCal import failing due to colon instead of semi-colon.
+#1252952 by eosrei: Make "all day" checkbox configurable on a per field instance
+ basis.
+#1266144 by arlinsandbulte: Clarify Default End Date Setting.
+#1261478 by stevector and KarenS, Reconfigure the back/next buttons into item
+ lists so Views ajax pager works right.
+#1262960 by KarenS: Add a new module to work with the Context module to set a
+ condition based on the value of a date field.
+#1216878 by KarenS: Re-introduce 'repeat' as a field setting rather than a
+ widget type so people can't try to switch back and forth between repeating and
+ non-repeating dates. Eliminate repeat widgets.
-The UNTIL date was not getting included in repeating results and that is now fixed. This is an API change of sorts
-for anyone who worked around the issue by setting it ahead.
+Bugfixes:
+#1280658 and follow up to Issue #1238660 by KarenS, tockliasteroid: Rework the
+ format control over the summary title and apply it to the title() callback.
+#1276622 by ArtistConk: Make sure Except date contains no default value.
+#1153766 by fago: More work on the entity property setters and getters.
+#1331214 by KarenS: Make sure Date Migrate properly handles empty date values.
+#1285224 by KarenS: Make sure Date Migrate works for importing repeating dates
+ now that widgets have changed.
+#1162290 by KarenS: Make sure date for example formats avoids confusing short
+ and long month names.
+By KarenS: Re-organize handling of custom date formats.
+#1122038 by KarenS: Make sure empty values are not passed to Views to be themed
+ for repeating dates.
+#1101284 by pfournier: Expand regex for Month names to catch more possible
+ variations.
+#1343406 by slashrsm: Add back the caching of the views fields list.
+#1302374 by miro_dietiker: Account for an inconsistency in core handling of
+ non-existant date formats.
+#1344014 by James Sharpe: Get rid of 'Repeats every 0 days' description.
+#1302212 by KarenS: Change the way default dates using custom code are created.
+#1292898 by KarenS: Check for all day checkbox in the basic date element
+ validation so empty time for newly added elements still passes validation.
+#1252952 by KarenS: Follow up, Move checkbox setting to the same spot where time
+ is set, and don't show option on dates without time.
+#1335818 by joelpitter: Don't create a date for empty values in the date getters
+ and setters.
+#1271726 by KarenS: Keep default_value out of exposed form so it won't show up
+ in pager.
+#1017866 by KarenS: Fix miscellaneous problems where filter/argument incorrectly
+ do timezone adjustment.
+#1103032 by KarenS: Attempt to add setters to date entity metadata so Rules can
+ use them.
+#1153766 by KarenS: Adapt metadata functions to the pattern in the current
+ Entity code, add $info to the getters.
+#1278876 by basicmagic.net: Typo in date.css.
+#752550 by Fonant: Week number gets printed twice.
+#1052586 by jpsolero: Problem with Date API when using Calendar with argument
+ set to "Week" granularity and "current date" default argument
+#1266144 by KarenS: End date same as start date default not being respected.
+#1239934 by casey: Fix javascript exception in date_year_range.js.
+#1310558 by KarenS: Don't show extra label on exposed date filter.
+By KarenS: Fix bug in Date Popup that still uses the current date when the
+ default date is empty.
+#1335578 by aaronbauman: Make it possible to pass in +/- 1000 years to years
+ back/forward.
+#1292516 by mcarbone: Fix Uninitialized string offset in Date Migrate.
+#1084980 by jwilson3: Set default value for $granularity to be array in
+ date_formatter_format.
+#1227350 by grendzy: Summary view should not be calling date_forbid().
+#1286570 by KarenS: Fix undefined index error caused by using a remember value
+ without checking if it exists.
+#1337440 by phoenix: Fix syntax error in vcalendar tpl file.
+#1103032 by KarenS: Add plain date formatter and set it to be the default token
+ formatter.
+#1177684 by tim.plunket: Fix typo in last commit.
+#1177684 by KarenS: Wrong translation of short month name.
+#1201342 by colinlee, alexprv: Comment out SQLSVR timezone adjustment until it
+ gets fixed properly.
+#1308274 by sneyerst: SQL Server DATEPART function cannot accept composed
+ datetime formats.
+#1308266 by sneyerst: Fix arithmetic overflow in SQLSVR.
+#1333104 by tim.plunkett: Check that $field['settings'] exists in
+ date_is_repeat_field().
+By KarenS: Error message for years back and forward doesn't match new labels,
+ should be Starting year and Ending year.
+#1179715 by KarenS: Switch drupal_array_get_nested_value() to use 'values'
+ instead of 'input', where it makes sense, and simplify some of this code.
+#1179715 by KarenS: Create a helper function for testing hidden/disabled dates
+ and test each date element and validator to skip processing in that case.
+#1179715 by KarenS: When hidden by #access=FALSE, repeating date fields were
+ getting removed and not replaced.
+#1179715 by KarenS: By pass date repeat widget processing and validation when
+ element is hidden from user.
+#1179715 by KarenS: Don't do timezone adjustments in the widget, wait for
+ #process so we can skip it when the date field has been hidden by #access.
+#1338194 by KarenS: Logic for creating end date wasn't taking into account the
+ possibility that a field might have no value2.
+#1179715 by KarenS: Default value callback for the timezone widget was not
+ returning an array.
+#1179716 by KarenS: Remove value_callback for date_repeat and date_combo forms,
+ the default behavior works fine.
+#1178716 by das-peter: Use drupal_array_get_nested_value() in Date Repeat
+ instead of trying to find it manually.
+#1178716 by das-peter, KarenS: Tweak the date repeat widget to identify empty
+ input when used on nodes with translation.
+#1178716 by das-peter, KarenS: Fix date repeat form values that are not arrays
+ when hidden on a node that has translation.
+#1178176 by das-peter: Fix date_combo_value_callback to return NULL to avoid
+ data lost on untranslatable dates used with Entity Translation.
+By KarenS: Date Context module was making incorrect assumptions about the
+ $language of the field.
+#1237974 by KarenS: Schema module wants the datetime column to be lower case.
+#1233084 by KarenS: fix a few places that were wrapping $instance['label'] with
+ t().
+#1188380 by Xen, jherencia: use #title instead of field['label'] in date display
+ because that has the i18n translation.
+#1330768 by das-peter: remove whitespace.
+By KarenS: Tweak date_pager_url to allow a way to create non-absolute urls.
+By KarenS: Make sure deleted displays won't create errors in Views by returning
+ FALSE in date_forbid() if there is no date argument.
+#1257830 by KarenS: Beef up the logic when creating the date repeat tabs to work
+ for more kinds of entities.
+#1260962 by KarenS: Repeating date fields should save the date even if there is
+ no repeat information.
+#1241836 by kzoli: Fix undefined cardinality indexes.
+#1233722 by KarenS: Fix undefined index notice in pager when other filters are
+ used.
-The All Day checkbox and All Day themes were moved into a separate module, using new hooks added to the date
-processing. This module should serve as an example of how other modules can inject functionality into date fields.
-
-A new module has been added for integrating the Date Repeat API into date fields. Some of this code has been
-moved into the new module, more of it will be moved later as I figure out how to unwind it from the base
-processing. An update hook has been added to enable this module by default for existing sites. If you don't
-use Repeating dates you can disable it.
-
-New Features/Major Changes
-
-- Issue #1229378 by ksenzee, Sync the end date with the start date on new dates using select widgets.
-- Issue #1236216, Move the repeating date integration out of the Date module and into a separate, Date Repeat Field module.
-- Issue #874322, The All Day functionality has been moved into a separate module and hooks were added to make it easier for other modules to inject steps into date processing.
-- Issue #1267046, Include the UNTIL date in repeating results..
-- Issue #1354606 by temaruk, Rework the repeating date UI to make it more user-friendly.
-- Issue #1362654, Remove Advanced Help integration, it needs a total rewrite.
-- Issue #1357362, Remove Date Browser, use Date Pager instead.
-- Issue #1354606, Make sure COUNT option without UNTIL date can be handled correctly by repeating date computations.
-
-Bugfixes
-
-- Fix to new default date handling, the default date has to set a date in the database timezone, not the display timezone.
-- Issue #1245106 by Gábor Hojtsy, Hide the option to add the delta into the view for single value fields.
-- Issue #1370876, Make sure new Date All Day code does not try to set the popup values if Date Popup is disabled.
-- Issue #874322, Add back the date_field_all_day() function to avoid breaking other modules that are using it.
-- Fix Date text placeholder to display a formatted date instead of a format. Follow up to Date repeat UI changes.
-- Issue #1248520 by fearlsgroove, Use attribute selector on all day and end day checkboxes.
-- Issue #952446 and #1031690, Select dates with only year and month were not working.
-- Issue #1292152 by pfrenssen, Remove debug functions.
-- Issue #1338976 by Josh Benner, Adjust iCal unwrap to allow for leading spaces, per standard.
-- Issue #1352486 by d.novikov, Rework date SQL formatting for Microsoft SQL.
-- Issue #1266536, Keep timezone adjustments from altering the values for repeating date EXCEPTIONS and ADDITIONS.
-- Issue #1353488, Some repeating date calculations using PHP 5.3.6+ were not computing correctly.
-- Issue #1364026, Fix link to documentation, also move help to Date API module.
-- Issue #1276270, Fix fatal error when using repeat date on user.
-- Issue #1362758, Add empty file for the date_plugin_display_attachment.inc file that was removed, to avoid fatal errors if it is missing on a site that formerly used it.
-- Issue #1363460, Make sure widget dates do not end up with the current date when they should be empty.
-- Issue #1353488, Attempt to fix problem using date_date_set() in PHP 5.3.6+.
-- Date Migrate tests needed some fixes to conform to latest code.
-- Issue #1353790, Hide missing index notice if the value in the Date Popup does not match the expected value, it will still get trapped as a validation error.
-- Issue #1353790, Make sure Date Popup properly translates the default value if it includes month or day names.
-- Issue #1217796, Make sure that All Day formatting works correctly even if the All Day label is empty.
-- The repeat description was lost by a recent change to the theme that sent the element through the theme twice.
-- Remove date_get_nested_elements() function. Not being used and I don't want other code to start expecting it.
-- Issue #1266144, The end date should get set to blank if it is optional and matches the start date, but only if it is not populated by default values.
-- Issue #1349510, Make sure default values get populated before processing so they still get set on hidden fields.
-
-======================
-Version 7.x-2.0-alpha5
-======================
-
-Notes:
-The date repeat widgets have been removed to keep users from trying to change repeating dates into non-repeating dates.
-There are now just three widgets, Date Select, Date Text, and Date Popup. Whether or not a date is a repeating date
-is now controlled by a field setting.
-
-New Features/UX Changes/API Changes
-
-- Issue #1304056 by DamienMcKenna, Add option to date_difference to indicate direction of difference.
-- Issue #1238660, Add custom format option for the date format used in summary arguments.
-- Issue #1038482 by somanyfish, iCal import failing due to colon instead of semi-colon
-- Issue #1252952 by eosrei: Make "all day" checkbox configurable on a per field instance basis.
-- Issue #1266144 by arlinsandbulte: Clarify Default End Date Setting
-- Issue #1261478 by stevector and KarenS, Reconfigure the back/next buttons into item lists so Views ajax pager works right.
-- Issue #1262960, Add a new module to work with the Context module to set a condition based on the value of a date field.
-- Issue #1216878, Re-introduce 'repeat' as a field setting rather than a widget type so people can't try to switch back and forth between repeating and non-repeating dates. Eliminate repeat widgets.
-
-Bugfixes
-
-- Issue #1280658 and follow up to Issue #1238660 by KarenS and tockliasteroid, Rework the format control over the summary title and apply it to the title() callback.
-- Issue #1276622 by ArtistConk, Make sure Except date contains no default value.
-- Issue #1153766 by fago, More work on the entity property setters and getters.
-- Issue #1331214, Make sure Date Migrate properly handles empty date values.
-- Issue #1285224, Make sure Date Migrate works for importing repeating dates now that widgets have changed.
-- Issue #1162290, Make sure date for example formats avoids confusing short and long month names.
-- Re-organize handling of custom date formats.
-- Issue #1122038, Make sure empty values are not passed to Views to be themed for repeating dates.
-- Issue #1101284 by pfournier, Expand regex for Month names to catch more possible variations.
-- Issue #1343406 by slashrsm, add back the caching of the views fields list.
-- Issue #1302374 by miro_dietiker, Account for an inconsistency in core handling of non-existant date formats.
-- Issue #1344014 by James Sharpe, Get rid of 'Repeats every 0 days' description.
-- Issue #1302212, Change the way default dates using custom code are created.
-- Issue #1292898, Check for all day checkbox in the basic date element validation so empty time for newly added elements still passes validation.
-- Issue #1252952 follow up, Move checkbox setting to the same spot where time is set, and don't show option on dates without time.
-- Issue #1335818 by joelpitter, Don't create a date for empty values in the date getters and setters.
-- Issue #1271726, Keep default_value out of exposed form so it won't show up in pager.
-- Issue #1017866, Fix miscellaneous problems where filter/argument incorrectly do timezone adjustment.
-- Issue #1103032, Attempt to add setters to date entity metadata so Rules can use them.
-- Issue #1153766, Adapt metadata functions to the pattern in the current Entity code, add $info to the getters.
-- Issue #1278876 by basicmagic.net, Typo in date.css
-- Issue #752550 by Fonant, Week number gets printed twice
-- Issue #1052586 by jpsolero, Problem with Date API when using Calendar with argument set to "Week" granularity and "current date" default argument
-- Issue #1266144, End date same as start date default not being respected.
-- Issue #1239934 by casey, Fix javascript exception in date_year_range.js.
-- Issue #1310558, Don't show extra label on exposed date filter.
-- Fix bug in Date Popup that still uses the current date when the default date is empty.
-- Issue #1335578 by aaronbauman, Make it possible to pass in +/- 1000 years to years back/forward.
-- Issue #1292516 by mcarbone, Fix Uninitialized string offset in Date Migrate.
-- Issue #1084980 by jwilson3, Set default value for $granularity to be array in date_formatter_format.
-- Issue #1227350 by grendzy, Summary view should not be calling date_forbid().
-- Issue #1286570, Fix undefined index error caused by using a remember value without checking if it exists.
-- Issue #1337440 by phoenix, Fix syntax error in vcalendar tpl file.
-- Issue #1103032, Add plain date formatter and set it to be the default token formatter.
-- Issue #1177684 by tim.plunket, Fix typo in last commit.
-- Issue #1177684, Wrong translation of short month name.
-- Issue #1201342 by colinlee and alexprv, Comment out SQLSVR timezone adjustment until it gets fixed properly.
-- Issue #1308274 by sneyerst, SQL Server DATEPART function cannot accept composed datetime formats.
-- Issue #1308266 by sneyerst, Fix arithmetic overflow in SQLSVR.
-- Issue #1333104 by tim.plunkett, Check that $field['settings'] exists in date_is_repeat_field().
-- Error message for years back and forward doesn't match new labels, should be Starting year and Ending year.
-- Issue #1179715, Switch drupal_array_get_nested_value() to use 'values' instead of 'input', where it makes sense, and simplify some of this code.
-- Issue #1179715, Create a helper function for testing hidden/disabled dates and test each date element and validator to skip processing in that case.
-- Issue #1179715, When hidden by #access=FALSE, repeating date fields were getting removed and not replaced.
-- Issue #1179715, By pass date repeat widget processing and validation when element is hidden from user.
-- Issue #1179715, Don't do timezone adjustments in the widget, wait for #process so we can skip it when the date field has been hidden by #access.
-- Issue #1338194, Logic for creating end date wasn't taking into account the possibility that a field might have no value2.
-- Issue #1179715, Default value callback for the timezone widget was not returning an array.
-- Issue #1179716, Remove value_callback for date_repeat and date_combo forms, the default behavior works fine.
-- Issue #1178716 by das-peter, Use drupal_array_get_nested_value() in Date Repeat instead of trying to find it manually.
-- Issue #1178716 by das-peter and KarenS, Tweak the date repeat widget to identify empty input when used on nodes with translation.
-- Issue #1178716 by das-peter and KarenS, Fix date repeat form values that are not arrays when hidden on a node that has translation.
-- Issue #1178176 by das-peter, Fix date_combo_value_callback to return NULL to avoid data lost on untranslatable dates used with Entity Translation.
-- Date Context module was making incorrect assumptions about the $language of the field.
-- Issue #1237974, Schema module wants the datetime column to be lower case.
-- Issue #1233084, fix a few places that were wrapping $instance['label'] with t().
-- Issue #1188380 by Xen and jherencia, use #title instead of field['label'] in date display because that has the i18n translation.
-- Issue #1330768 by das-peter, remove whitespace.
-- Tweak date_pager_url to allow a way to create non-absolute urls.
-- Make sure deleted displays won't create errors in Views by returning FALSE in date_forbid() if there is no date argument.
-- Issue #1257830, Beef up the logic when creating the date repeat tabs to work for more kinds of entities.
-- Issue #1260962, Repeating date fields should save the date even if there is no repeat information.
-- Issue #1241836 by kzoli, Fix undefined cardinality indexes.
-- Issue #1233722, Fix undefined index notice in pager when other filters are used.
-
-======================
-Version 7.x-2.0-alpha4
-======================
+Date 7.x-2.0-alpha4, 2011-08-23
+-------------------------------
Notes to themers:
+Previous versions put dates with both From and To dates into a fieldset and
+other dates were not. The new code adds additional floating elements that are
+hard to contain, so now all dates are enclosed in fieldsets in the node form.
+There are also new elements on the form, an optional checkbox for hiding/showing
+the To date and an optional checkbox for hiding/showing time. Previously dates
+on the node form had 'From date' and 'To date' labels above them, this has been
+changed to remove those labels, using the Google calendar date entry screen as a
+model. This simplifies the node form and dates take up less space. A light grey
+border has been added around each collection of dates (the From date and the To
+date). The display of labels above the date parts (year, month, day, date, time,
+etc) is controlled in the field settings. Previous versions did not always honor
+those settings, this one does.
-Previous versions put dates with both From and To dates into a fieldset and other dates were not.
-The new code adds additional floating elements that are hard to contain, so now all dates are
-enclosed in fieldsets in the node form. There are also new elements on the form, an optional
-checkbox for hiding/showing the To date and an optional checkbox for hiding/showing time.
-Previously dates on the node form had 'From date' and 'To date' labels above them, this
-has been changed to remove those labels, using the Google calendar date entry screen
-as a model. This simplifies the node form and dates take up less space. A light grey border
-has been added around each collection of dates (the From date and the To date). The display
-of labels above the date parts (year, month, day, date, time, etc) is controlled in the
-field settings. Previous versions did not always honor those settings, this one does.
+New Features/UX Improvements:
+#1249724 by KarenS, Gábor Hojtsy, David_Rothstein: Improve usability of date and
+ time input configuration.
+#1250784 by David_Rothstein: Add user-friendly labels for start and end date
+ values in Views.
+#742146 by KarenS: Add option to remove X-WR-CALNAME if VEVENT is not a feed.
+By KarenS: Add option to change method from PUBLISH to REQUEST in VCALENDAR.
+#334435 by KarenS: Add a theme function for the 'Date' and 'Time' labels in the
+ Popup widget.
+#1239956 by David_Rothstein: Change the default separation between from and t
+ dates to use 'to' instead of a hyphen.
+#1240628 by David_Rothstein: Make the date increment default to 15 instead of 1.
+#1249724 by David_Rothstein: Improve usability of date and time input
+ configuration.
+#1177198 by tim.plunkett: Allow CTools to process #dependency for date elements.
+#1245562 by David_Rothstein: Rename the default date display format to something
+ friendlier
+#1239934 by David_Rothstein, Gábor Hojtsy: Reuse the "years back and forward"
+ dropdown widget on the Views filter settings page.
+#1239228 by Gábor Hojtsy: Date Views filter form UI improvements, clarify the
+ way absolute and relative dates work.
+#233047 by ksenzee, David_Rothstein: Add the Vegas jQuery timepicker as a new
+ time selector option.
+#1145976 by tim.plunkett, KarenS: Add 'is date' identifier to all date handlers.
+#1234140 by arlinsundbulte: Change terminology in user-facing text from 'From/To
+ Date' to 'Start/End Date'.
+#1233948 by KarenS: Add 'All Day' checkbox to hide/show the time parts of the
+ date form. If All day is chosen, any time is replaced with 00:00:00 when the
+ form is submitted.
+#1233612 by KarenS: Add 'Collect end date' checkbox for dates with optional end
+ dates to hide/show the end date.
+#821200 by scor, KarenS: Add RDF support to the date field.
+#1211744 by EclipseGC, KarenS: Add a Date pager plugin that is designed to add
+ paging in conjunction with a Date argument.
+#1180612 by mikeryan: Add support for Migrate module.
+#1198320 by ksenzee: David_Rothstein, Noyz: Make UI improvements to field
+ settings page.
+#1215738 by ksenzee: Make granularity settings checkboxes horizontal.
+#1215686 by ksenzee: Change name of date field types to be more intuitive.
+#1216996 by ksenzee: Change the years back/forward setting into two drop down
+ boxes.
+#1222468 by ksenzee: Hide timezone options when using granularity without time.
+#1229388 by ksenzee: Hide formatter from/to choices on fields without multiple
+ values.
-New Features/UX Improvements
+Removed deprecated functions:
+By KarenS: Removed date_handler_fields(), only applicable to D6 code.
+By KarenS: Removed date_views_real_url() and date_views_page_url(), used by
+ older calendar version.
+By KarenS: Remove unused date_handler_field_multiple.
-- Issue #1249724 by KarenS, Gábor Hojtsy, David_Rothstein, Improve usability of date and time input configuration.
-- Issue #1250784 by David_Rothstein, Add user-friendly labels for start and end date values in Views.
-- Issue #742146, Add option to remove X-WR-CALNAME if VEVENT is not a feed.
-- Add option to change method from PUBLISH to REQUEST in VCALENDAR.
-- Issue #334435, Add a theme function for the 'Date' and 'Time' labels in the Popup widget.
-- Issue #1239956 by David_Rothstein, Change the default separation between from and to dates to use 'to' instead of a hyphen.
-- Issue #1240628 by David_Rothstein, Make the date increment default to 15 instead of 1.
-- Issue #1249724 by David_Rothstein: Improve usability of date and time input configuration
-- Issue #1177198 by tim.plunkett: Allow CTools to process #dependency for date elements.
-- Issue #1245562 by David_Rothstein, Rename the default date display format to something friendlier
-- Issue #1239934 by David_Rothstein and Gábor Hojtsy, Reuse the "years back and forward" dropdown widget on the Views filter settings page.
-- Issue #1239228 by Gábor Hojtsy, Date Views filter form UI improvements, clarify the way absolute and relative dates work.
-- Issue #233047 by ksenzee and David_Rothstein, Add the Vegas jQuery timepicker as a new time selector option.
-- Issue #1145976 by tim.plunkett and KarenS, Add 'is date' identifier to all date handlers.
-- Issue #1234140 by arlinsundbulte, Change terminology in user-facing text from 'From/To Date' to 'Start/End Date'.
-- Issue #1233948 by KarenS, Add 'All Day' checkbox to hide/show the time parts of the date form. If All day is chosen, any time is replaced with 00:00:00 when the form is submitted.
-- Issue #1233612 by KarenS, Add 'Collect end date' checkbox for dates with optional end dates to hide/show the end date.
-- Issue #821200 by scor and KarenS, Add RDF support to the date field.
-- Issue #1211744 by EclipseGC and KarenS, Add a Date pager plugin that is designed to add paging in conjunction with a Date argument.
-- Issue #1180612 by mikeryan, Add support for Migrate module.
-- Issue #1198320 by ksenzee, David_Rothstein, Noyz: Make UI improvements to field settings page.
-- Issue #1215738 by ksenzee, Make granularity settings checkboxes horizontal.
-- Issue #1215686 by ksenzee, Change name of date field types to be more intuitive.
-- Issue #1216996 by ksenzee, Change the years back/forward setting into two drop down boxes.
-- Issue #1222468 by ksenzee, Hide timezone options when using granularity without time.
-- Issue #1229388 by ksenzee, Hide formatter from/to choices on fields without multiple values.
+Tests:
+#1251592 by David_Rothstein: Set reasonable default values if date formats have
+ not been configured, and add tests for that.
+#1242764 by KarenS: Add tests for every possible combination of field type,
+ timezone handling, and granularity.
+By KarenS: More work on tests, add a foreach loop to run through all field_type
+ /widget_type combinations.
+By KarenS: Rework tests to use a base class rather than copying the same
+ functions everywhere.
+#1209408 by KarenS: Make sure date_repeat_calc() returns empty array for
+ FREQ=NONE and INTERVAL=0, also add a test for that.
+#1161006 by justinrandall: Add tests to check that dates that should have time
+ but do not are correctly caught in validation.
-Removed deprecated functions
+Bugfixes:
+#1256406 by q0rban: use variable_get() in hook_requirments().
+By KarenS: Follow up to Issue #1145976, Make sure 'is date' only gets applied to
+ the date values, not delta, timezone, etc.
+#1238364 by KarenS: Make sure the Date pager doesn't throw errors if the default
+ date is missing.
+#1246416 by KarenS: Add info to the Date Popup README.txt about how to download
+ the WVega timepicker.
+#1253230 by KarenS: Package name of Date Migrate was different than the other
+ Date components.
+#1251592 by KarenS: Add installation message and system requirements warnings
+ about missing system date settings.
+#1250784 by KarenS: Don't save psuedo field settings created by the new UI in
+ the field itself.
+#1239228 by David_Rothstein: Always add Date Views css to View UI edit forms.
+#1254540 by David_Rothstein: Move borders off of the wrappers so they don't
+ appear when the dates inside them are hidden.
+#1253248 by David_Rothstein: Move RDF attribute handling to preprocess function.
+#1087798 by anj: Fix X-WR-CALNAME in VCALENDAR.
+#1254582 by KarenS: Repeat additions need to be adjusted to use the same time as
+ the original date.
+By KarenS: Move vcalendar and vevent templates from Date Views to Date API
+ modules.
+By KarenS: Follow up to Issue #1250344, We don't need extra space when there is
+ a description, only when there is not.
+#1239228 by Gábor Hojtsy: More tweaks to filter css.
+#1244924 by Gábor Hojtsy: Minor text improvements in date filter configuration.
+#1245556 by David_Rothstein: Date granularity description incorrectly implies
+ that it affects the date attributes that are displayed
+#1247444 by Gábor Hojtsy: Give a little breathing space to the date year range
+ "other" field
+#1250344 by jessebeach: Fix padding around date fields by adding clearfix class.
+#1249116 by yched: Fix various glitches with D6 migration code.
+#1243022 by fmosca, KarenS: Make sure all_day #states visibility is only set
+ when there is a value for all_day.
+#1236192 by loganfsmyth: Make sure #date_label_position has a default value in
+ the Date Popup module.
+#1246416 by KarenS: Test whether libraries_get_path() returns a valid path
+ before using it.
+#1235994 by KarenS: Don't display 'All Day' when using a format that has no
+ time.
+#1245690 by mikeryan: Migration plugin missing seconds from date formats.
+#1229406 by David Rothstein, Gábor Hojtsy, tim.plunkett: Fix broken timepicker
+ in Chrome and Safari.
+#1239412 by keithm: Fix validation error when #access is false.
+#1232522 by KarenS: Don't alter field_ui_field_edit form except on date fields.
+#1243842 by KarenS: Make sure the All Day and Show End Date flags work correctly
+ in unlimited value fields that use ajax.
+By KarenS: Follow up to Issue #1239956, Fix tests broken by change in date
+ separator.
+#1241576 by KarenS: Fix date combo validation for all-day dates so they don't
+ fail validation because the format is unexpected.
+By KarenS: Take the guesswork out of examining Date info for Views, add is_field
+ flag.
+By KarenS: Follow up to Issue #874322, Date popup field needs to accept date
+ without time for the all day flag to work.
+By KarenS: Follow up to Issue #1130814, It looks like the modification is not
+ needed in date_repeat_set_month_day and date_repeat_set_year_day.
+#1160132 by seanbfuller, KarenS: Exposed filter widgets were not displaying the
+ default values.
+By KarenS: Adjust the way widgets are styled in Views exposed filters after the
+ latest style changes for form elements.
+#1234114 by arlinsandbulte: Add more space between checkboxes.
+#1234090 by KarenS: Fix undefined variable 'all_day'.
+#1232570 by dboulet: Remove some unneeded duplication of core clearfix and other
+ css cleanup.
+#1232614 by dboulet: Date css should not be setting font family.
+By KarenS: Timezone and Date Popup weren't obeying the settings for displaying
+ the date part label.
+#1130814 by cdracars, mikeryan, mayobutter: Fix date_modify difference between
+ PHP 5.3.5 and 5.3.6 so both work to compute repeating dates.
+#1017866 by KarenS, Jason89s: Make sure views argument and filter don't do
+ timezone adjustment for dates that don't have time.
+#1204988 by paulsheldrake: Remove IE6 code from datepicker CSS.
+#1231864 by Damien McKenna: Clean up line endings in vevent and vcalendar tpl
+ files.
+#1231382 by dboulet: Clean up date css, code style fixes.
+By KarenS: Date repeat additions and exceptions need to be reworked into full,
+ timezone-adjusted, datetime values when passing them to FAPI as default
+ values.
+#1223034 by c4rl: Make sure repeating date additions and exceptions work
+ correctly when there is more than one repeating date in the same form.
+#1229362 by KarenS: Date Popup module needs date_is_date() function, which
+ should not require Date module. Move that to Date API.
+#1227208 by ksenzee: Minor text changes.
+#1094408 by KarenS: Change method of identifying Field module filters, using the
+ name of the group is not robust enough.
+#1227264 by gapa: Fix wrong class in date-pager.tpl.php.
+#1207540 by KarenS: Summary grouping won't work right unless the formula alias
+ doesn't match an actual field value.
+#1227350 by KarenS: Summary query still needs the formula, add it back.
+By KarenS: Fix 'variables cannot be passed by reference' notice on repeats page.
+#1222736 by KarenS: Fix export errors caused when previous export fix of using
+ export plugins got broken by changes in Views.
+#1077490 by KarenS: Fix notices about missing #date_flexible.
+By KarenS: Move the 'top' date pager to below the header instead of below
+ attachment_before so you can add header text above it.
+By KarenS: The value for variable_get('date_first_day') should default to zero
+ to match core default.
+#1147620 by KarenS: With an assist from tim.plunkett, Fix the query so it will
+ locate dates that span days or months by checking the intersection of the date
+ range and the query range. Also add an option to the argument so you can do a
+ simple query for either the from or to date when checking the whole range
+ isn't the right solution.
+#307274 by ksenzee: Fix broken validation for absolute value in years back
+ /forward.
+#1173374 by fietserwin: Remove translation of the jQuery datepicker day and
+ month names, now handled by core.
+#1192020 by tim.plunkett: Fixed date granularity is too fragile in
+ date_field_all_day().
+#1110012 by KarenS: Remove 'parent' items from Views plugins, no longer needed?
+ See if this fixes the issue.
+#1183892 by KarenS: Initialize $identifier in date_views_filter_handler_simple.
+#1103290 by stickywes, ingaro: Change postgres 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS'
+ to 'FMYYYY-FMMM-FMDDTFMHH24:FMMI:FMSS'.
+#1186528 by jox: Make date field combo label translatable.
+#1123186 by KingJoshi: Fix misnamed date_part_hour_prefix in hook_theme().
+#1032942 by fietserwin: Rename date popup functions that are getting picked up
+ by theme('date').
+#1206756 by KarenS: More tweaks to the validation changes. They were blocking
+ zero times and causing some test failures.
+#1197352 by KarenS: Don't display language about from and to dates when there
+ is no todate.
+#1201288 by rafa0961: fix broken references to SQLSERVER.
+By KarenS: More work on cleaning up validation, add in some ideas from
+ fearlsgrove about checking the granularity of the input array against the
+ expected granularity.
+#1161006 Dates that should have time but do not were not correctly caught in
+ validation.
+By KarenS: Get rid of overlapping formatter functionality. There should be a
+ default formatter with the option to choose a date format as a setting, not a
+ formatter for each format. This was a leftover from the D6 functionality.
+#1159404 by mikeryan: Fix incorrect call to parse an rrule in
+ date_repeat_build_dates().
+#1160656 by jjs: Replace missing break in date_api.sql.inc that breaks
+ PostgreSQL.
+#1150454 by KarenS: Fix undefined index notices for repeat_collapsed value.
+#1150462 by KarenS: Put length limit on content type names created by Date Tools
+ so block delta won't overflow the allowed size.
+#1136734 by KarenS: When migrating date format data from D6 to D7, don't try to
+ overwrite existing custom values.
+#1161042 by Ollie222: Date filters using time were inconsistently formatted.
+#1130884 by KarenS: Bad logic in 'between' filter SQL, should always join with
+ AND.
+#1139418 by ankur: Bad logic in week argument SQL, should always join with AND.
+#1118356 by KarenS: Disabling the Timepicker was having no effect.
+#408770 by vkareh: Make sure dates with #access = FALSE get passed through
+ date_combo_element_process().
+#1037174 by das-peter: add ajax support to date popup.
+#1160614 by joelstein: Make sure date repeat rule gets split correctly no matter
+ which line endings were used.
+#1110708 by mr.baileys: Fix problem combining date filter with other exposed
+ filters.
+By KarenS: Switch some references to $node to use $entity instead.
+#1112206, add a dummy field to the date navigation bar query to keep it from
+ trying to create invalid sql.
+#1112206, $this->view->query->clear_fields() is still need for date_browser to
+ keep Views from trying to use missing field values.
+By KarenS: Date browser only works with date_argument, should work with any
+ argument derived from date.
-- Removed date_handler_fields(), only applicable to D6 code.
-- Removed date_views_real_url() and date_views_page_url(), used by older calendar version.
-- Remove unused date_handler_field_multiple.
-Tests
+Date 7.x-2.0-alpha3, 2011-04-26
+-------------------------------
+#1138700 by KarenS: missed a couple references to the construct() function.
-- Issue #1251592 by David_Rothstein, Set reasonable default values if date formats have not been configured, and add tests for that.
-- Issue #1242764 Add tests for every possible combination of field type, timezone handling, and granularity.
-- More work on tests, add a foreach loop to run through all field_type/widget_type combinations.
-- Rework tests to use a base class rather than copying the same functions everywhere.
-- Issue #1209408 Make sure date_repeat_calc() returns empty array for FREQ=NONE and INTERVAL=0, also add a test for that.
-- Issue #1161006 by justinrandall, Add tests to check that dates that should have time but do not are correctly caught in validation.
-Bugfixes
+Date 7.x-2.0-alpha2, 2011-04-26
+-------------------------------
+By KarenS: Follow up to Issue #1103290, constructor was not set up correctly and
+ did not get triggered, so none of the date handlers had a db_type.
+#1138622 by KarenS: preliminary pass at adding support for SQL Server.
+#1136618 by ksenzee, Fix broken hide/show capability for date filter values.
+#1059078 Add preliminary support for SQLite dates.
+#1103290 by kevintheday, Use db_driver() to determine database engine.
+By KarenS: The 'now' values got broken again somewhere along the line. Now we
+ need to switch the ISO format used by our SQL queries back to the datetime
+ format the widgets use.
+By KarenS: Looks like Views changed ['expose']['operator'] to
+ ['expose']['operator_id'].
+#1115770, Make sure filters values are switched back to ISO format so time
+ comparisons work correctly.
+#1132916 by znerol, Fix a couple more usages of date_default_timezone_name().
+#1131308 by KarenS: Don't try to do timzone conversion when there is no
+ localzone for a field.
+#1093222 Fix broken function to remove calendar views.
+#820670 Add update to move D6 date format data to D7 data.
+1074344 Fix problem with date select widget that keeps resetting pm back to am.
+#1001186 by KarenS: Make sure that a 2 digit year is flagged as an error.
+#1117420 by threewestwinds: Make timepicker formats more useful.
+#1126408 by thekevinday: Add more sql formats to date api.
+#1129326 by robertom: Add missing value to element in date_combo.
+#998220 by jamsilver, yched: Fix handling of validation in date_combo. This
+ also fixes errors when using a date in Profile 2 and Field Collections.
+#1022592 by andypost, tim.plunkett optimize hook_form_alter into
+ hook_form_FORMID_alter.
+1021424 by joostvdl, wiizzard: Fix context in translations to use core values.
+By KarenS: Remove extra fields from the Date field. I think the filter and
+ argument now get the right tables joined in without that. We still need the
+ extra fields on calendar, but now we will only add them in the calendar view.
+By KarenS: Fix some notices in vcalendar theme.
+By KarenS: Fix the mini calendar querystring.
+By KarenS: Fix logic for day argument formula.
+By KarenS: Fix logic for week argument formula.
+#1086582 by bojanz: Summary options are in a different place now, fix the method
+ of removing the summary option on multiple-date arguments.
+By KarenS: Views renamed 'wildcard' to 'exception'.
+By KarenS: Apparently the handler->argument value is not always populated.
+By KarenS: Fix fallback value for date_group.
+#1103032 by tim.plunkett: Remove token integration code until Token module is
+ fixed.
+By KarenS: Now that there is no group of 'Fields' we need different tests to
+ tell if this is a field filter.
+By KarenS: Views changed the group name of fields from 'Fields' to 'Content'.
+ Blech, broke everything.
+By KarenS: Fix potential error if handler is broken.
+By KarenS: Remove reference to a function that no longer exists in Views.
+#1116962 by jpontani, mordonez: Parse Error - date_views_fields.inc on line 119.
+By KarenS: Fix the logic for year and month only dates.
+By KarenS: Add helper function to test if handler is a date handler.
+By KarenS: Fix broken handling when creating dates from timestamps.
+By KarenS: Set some defaults for dates without month or day.
+##1094408 by Boobaa: Date field not showing up in views arguments in localized
+ site
+#1018412 by omerida: get_class() called without object.
+By KarenS: There were some problems when creating a year-only date using the
+ select filter caused by trying to create a date with zeros in the month and
+ day. Fix the date building logic to force a valid month and day into them.
+By KarenS: Complex filters were not using the date handler of the individual
+ fields.
+#1100934 by KarenS: Replace deprecated date_array() function.
+By KarenS: #1096246 Date argument also was not applying the group method in the
+ right place in the query, causing that method to be applied to all filters.
+By KarenS: Missed a couple places when re-naming the get_value() function in the
+ filter.
+By KarenS: Fix more notices.
+#1096246 by KarenS: Date filter was not apply the group method in the right
+ place in the query, causing that method to be applied to all filters.
+By KarenS: Fix undefined index notice.
+By KarenS: Remove non-used function.
+#1082654 by arlinsandbulte: Remove master branch files and explain in readme.txt
+#906622 by bfroehle: Start cleanup of Date token code.
+By KarenS: Fix typo in form processing.
+By KarenS: Clean up the admin summary for the date filter.
+By KarenS: Fix another use of get_value() in the filter.
+By KarenS: Fix some strict errors in the views filter.
+#1094408 by Boobaa: Date field not showing up in views arguments in localized.
+ site.
+#1041428 by tim.plunkett: Fix logic errors in 'All Day' computations.
+#1054458 by KarenS: Move date_increment_round() function into Date API module so
+ it is always available.
+#745074 by rsevero: Don't test for valid timezone-adjusted date for dates that
+ don't use time.
+#1076992 by KarenS: The timezone element never got completely updated to D7.
+#1013662 by developer-x: Remove check for start and end date - this prevented
+ multiday-all day events from showing 'All Day'.
-- Issue #1256406 by q0rban, use variable_get() in hook_requirments().
-- Follow up to Issue #1145976, Make sure 'is date' only gets applied to the date values, not delta, timezone, etc.
-- Issue #1238364, Make sure the Date pager doesn't throw errors if the default date is missing.
-- Issue #1246416, Add info to the Date Popup README.txt about how to download the WVega timepicker.
-- Issue #1253230, Package name of Date Migrate was different than the other Date components.
-- Issue #1251592, Add installation message and system requirements warnings about missing system date settings.
-- Issue #1250784, Don't save psuedo field settings created by the new UI in the field itself.
-- Issue #1239228 by David_Rothstein, Always add Date Views css to View UI edit forms.
-- Issue #1254540 by David_Rothstein, Move borders off of the wrappers so they don't appear when the dates inside them are hidden.
-- Issue #1253248 by David_Rothstein, Move RDF attributes handling to preprocess function.
-- Issue #1087798 by anj, Fix X-WR-CALNAME in VCALENDAR.
-- Issue #1254582 Repeat additions need to be adjusted to use the same time as the original date.
-- Move vcalendar and vevent templates from Date Views to Date API modules.
-- Follow up to Issue #1250344, We don't need extra space when there is a description, only when there is not.
-- Issue #1239228 by Gábor Hojtsy, More tweaks to filter css.
-- Issue #1244924 by Gábor Hojtsy, Minor text improvements in date filter configuration
-- Issue #1245556 by David_Rothstein, Date granularity description incorrectly implies that it affects the date attributes that are displayed
-- Issue #1247444 by Gábor Hojtsy, Give a little breathing space to the date year range "other" field
-- Issue #1250344 by jessebeach, Fix padding around date fields by adding clearfix class.
-- Issue #1249116 by yched, Fix various glitches with D6 migration code.
-- Issue #1243022 by fmosca and KarenS, Make sure all_day #states visibility is only set when there is a value for all_day.
-- Issue #1236192 by loganfsmyth, Make sure #date_label_position has a default value in the Date Popup module.
-- Issue #1246416, Test whether libraries_get_path() returns a valid path before using it.
-- Issue #1235994, Don't display 'All Day' when using a format that has no time.
-- Issue #1245690 by mikeryan, Migration plugin missing seconds from date formats
-- Issue #1229406 by David Rothstein, Gábor Hojtsy, and tim.plunkett Fix broken timepicker in Chrome and Safari.
-- Issue #1239412 by keithm, Fix validation error when #access is false.
-- Issue #1232522, Don't alter field_ui_field_edit form except on date fields.
-- Issue #1243842, Make sure the All Day and Show End Date flags work correctly in unlimited value fields that use ajax.
-- Follow up to Issue #1239956, Fix tests broken by change in date separator.
-- Issue #1241576, Fix date combo validation for all-day dates so they don't fail validation because the format is unexpected.
-- Take the guesswork out of examining Date info for Views, add is_field flag.
-- Follow up to Issue #874322, Date popup field needs to accept date without time for the all day flag to work.
-- Follow up to Issue #1130814, It looks like the modification is not needed in date_repeat_set_month_day and date_repeat_set_year_day.
-- Issue #1160132 by seanbfuller and KarenS, Exposed filter widgets were not displaying the default values.
-- Adjust the way widgets are styled in Views exposed filters after the latest style changes for form elements.
-- Issue #1234114 by arlinsandbulte, Add more space between checkboxes.
-- Issue #1234090, Fix undefined variable 'all_day'.
-- Issue #1232570 by dboulet, Remove some unneeded duplication of core clearfix and other css cleanup.
-- Issue #1232614 by dboulet, Date css should not be setting font family.
-- Timezone and Date Popup weren't obeying the settings for displaying the date part label.
-- Issue #1130814 by cdracars, mikeryan, mayobutter, Fix date_modify difference between PHP 5.3.5 and 5.3.6 so both work to compute repeating dates.
-- Issue #1017866 by KarenS and Jason89s, Make sure views argument and filter don't do timezone adjustment for dates that don't have time.
-- Issue #1204988 by paulsheldrake, Remove IE6 code from datepicker CSS.
-- Issue #1231864 by Damien McKenna, Clean up line endings in vevent and vcalendar tpl files.
-- Issue #1231382 by dboulet, Clean up date css, code style fixes.
-- Date repeat additions and exceptions need to be reworked into full, timezone-adjusted, datetime values when passing them to FAPI as default values.
-- Issue #1223034 by c4rl, Make sure repeating date additions and exceptions work correctly when there is more than one repeating date in the same form.
-- Issue #1229362, Date Popup module needs date_is_date() function, which should not require Date module. Move that to Date API.
-- Issue #1227208 by ksenzee, Minor text changes.
-- Issue #1094408, Change method of identifying Field module filters, using the name of the group is not robust enough.
-- Issue #1227264 by gapa, Fix wrong class in date-pager.tpl.php.
-- Issue #1207540, Summary grouping won't work right unless the formula alias doesn't match an actual field value.
-- Issue #1227350 Summary query still needs the formula, add it back.
-- Fix 'variables cannot be passed by reference' notice on repeats page.
-- Issue #1222736 Fix export errors caused when previous export fix of using export plugins got broken by changes in Views.
-- Issue #1077490 Fix notices about missing #date_flexible.
-- Move the 'top' date pager to below the header instead of below attachment_before so you can add header text above it.
-- The value for variable_get('date_first_day') should default to zero to match core default.
-- Issue #1147620 by KarenS with an assist from tim.plunkett, Fix the query so it will locate dates that span days or months by checking the intersection of the date range and the query range. Also add an option to the argument so you can do a simple query for either the from or to date when checking the whole range isn't the right solution.
-- Issue #307274 by ksenzee, Fix broken validation for absolute value in years back/forward.
-- Issue #1173374 by fietserwin, Remove translation of the jQuery datepicker day and month names, now handled by core.
-- Issue #1192020 by tim.plunkett: Fixed date granularity is too fragile in date_field_all_day().
-- Issue #1110012 Remove 'parent' items from Views plugins, no longer needed? See if this fixes the issue.
-- Issue #1183892, Initialize $identifier in date_views_filter_handler_simple.
-- Issue #1103290 by stickywes and ingaro, Change postgres 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS' to 'FMYYYY-FMMM-FMDDTFMHH24:FMMI:FMSS'.
-- Issue #1186528 by jox, Make date field combo label translatable.
-- Issue #1123186 by KingJoshi, Fix misnamed date_part_hour_prefix in hook_theme().
-- Issue #1032942 by fietserwin, Rename date popup functions that are getting picked up by theme('date').
-- Issue #1206756 More tweaks to the validation changes. They were blocking zero times and causing some test failures.
-- Issue #1197352 Don't display language about from and to dates when there is no todate.
-- Issue #1201288 by rafa0961, fix broken references to SQLSERVER.
-- More work on cleaning up validation, add in some ideas from fearlsgrove about checking the granularity of the input array against the expected granularity.
-- Issue #1161006 Dates that should have time but do not were not correctly caught in validation.
-- Get rid of overlapping formatter functionality. There should be a default formatter with the option to choose a date format as a setting, not a formatter for each format. This was a leftover from the D6 functionality.
-- Issue #1159404 by mikeryan, Fix incorrect call to parse an rrule in date_repeat_build_dates().
-- Issue #1160656 by jjs, Replace missing break in date_api.sql.inc that breaks PostgreSQL.
-- Issue #1150454, Fix undefined index notices for repeat_collapsed value.
-- Issue #1150462, Put length limit on content type names created by Date Tools so block delta won't overflow the allowed size.
-- Issue #1136734, When migrating date format data from D6 to D7, don't try to overwrite existing custom values.
-- Issue #1161042 by Ollie222, Date filters using time were inconsistently formatted.
-- Issue #1130884, Bad logic in 'between' filter SQL, should always join with AND.
-- Issue #1139418 by ankur, Bad logic in week argument SQL, should always join with AND.
-- Issue #1118356, Disabling the Timepicker was having no effect.
-- Issue #408770 by vkareh, Make sure dates with #access = FALSE get passed through date_combo_element_process().
-- Issue #1037174 by das-peter, add ajax support to date popup.
-- Issue #1160614 by joelstein, Make sure date repeat rule gets split correctly no matter which line endings were used.
-- Issue #1110708 by mr.baileys, Fix problem combining date filter with other exposed filters.
-- Switch some references to $node to use $entity instead.
-- Issue #1112206, add a dummy field to the date navigation bar query to keep it from trying to create invalid sql.
-- Issue #1112206, $this->view->query->clear_fields() is still need for date_browser to keep Views from trying to use missing field values.
-- Date browser only works with date_argument, should work with any argument derived from date.
-======================
-Version 7.x-2.0-alpha3
-======================
+Date 7.x-2.0-alpha1, 2011-03-09
+-------------------------------
+Start a new 7.x-2.x branch that will contain a complete re-work of the Views
+handling.
-- Issue #1138700, missed a couple references to the construct() function.
+The 7.x-2.x branch will totally re-work and simplify the Views filters. These
+changes may/will break some views and will require that you check views that use
+the date filter or argument to be sure they are still configured correctly.
-======================
-Version 7.x-2.0-alpha2
-======================
+There is a new date_filter_handler_simple for an individual date field that
+simplifies the Views handling by using most of the core Views field handling but
+adds in the possibility to set a default date using options like 'now', along
+with a choice of a month/day/year drop-down selector or popup calendar selector.
-- Follow up to Issue #1103290, constructor was not set up correctly and did not get triggered, so none of the date handlers had a db_type.
-- Issue #1138622, preliminary pass at adding support for SQL Server.
-- Issue #1136618 by ksenzee, Fix broken hide/show capability for date filter values.
-- Issue #1059078 Add preliminary support for SQLite dates.
-- Issue #1103290 by kevintheday, Use db_driver() to determine database engine.
-- The 'now' values got broken again somewhere along the line. Now we need to switch the ISO format used by our SQL queries back to the datetime format the widgets use.
-- Looks like Views changed ['expose']['operator'] to ['expose']['operator_id'].
-- Issue #1115770, Make sure filters values are switched back to ISO format so time comparisons work correctly.
-- Issue #1132916 by znerol, Fix a couple more usages of date_default_timezone_name().
-- Issue #1131308 Don't try to do timzone conversion when there is no localzone for a field.
-- Issue #1093222 Fix broken function to remove calendar views.
-- Issue #820670 Add update to move D6 date format data to D7 data.
-- Issue 1074344 Fix problem with date select widget that keeps resetting pm back to am.
-- Issue #1001186 Make sure that a 2 digit year is flagged as an error.
-- Issue #1117420 by threewestwinds, Make timepicker formats more useful.
-- Issue #1126408 by thekevinday, Add more sql formats to date api.
-- Issue #1129326 by robertom, add missing value to element in date_combo.
-- Issue #998220 by jamsilver and yched, fix handling of validation in date_combo. This also fixes errors when using a date in Profile 2 and Field Collections.
-- Issue #1022592 by andypost and tim.plunkett optimize hook_form_alter into hook_form FORMID_alter.
-- Issue 1021424 by joostvdl and wiizzard, fix context in translations to use core values.
-- Remove extra fields from the Date field. I think the filter and argument now get the right tables joined in without that. We still need the extra fields on calendar, but now we will only add them in the calendar view.
-- Fix some notices in vcalendar theme.
-- Fix the mini calendar querystring.
-- Fix logic for day argument formula.
-- Fix logic for week argument formula.
-- Issue #1086582 by bojanz, summary options are in a different place now, fix the method of removing the summary option on multiple-date arguments.
-- Views renamed 'wildcard' to 'exception'.
-- Apparently the handler->argument value is not always populated.
-- Fix fallback value for date_group.
-- Issue #1103032 by tim.plunkett, Remove token integration code until Token module is fixed.
-- Now that there is no group of 'Fields' we need different tests to tell if this is a field filter.
-- Views changed the group name of fields from 'Fields' to 'Content'. Blech, broke everything.
-- Fix potential error if handler is broken.
-- Remove reference to a function that no longer exists in Views.
-- Issue #1116962 by jpontani, mordonez: Parse Error - date_views_fields.inc on line 119.
-- Fix the logic for year and month only dates.
-- Add helper function to test if handler is a date handler.
-- Fix broken handling when creating dates from timestamps.
-- Set some defaults for dates without month or day.
-- Issue ##1094408 by Boobaa: Date field not showing up in views arguments in localized site
-- Issue #1018412 by omerida: get_class() called without object.
-- There were some problems when creating a year-only date using the select filter caused by trying to create a date with zeros in the month and day. Fix the date building logic to force a valid month and day into them.
-- Complex filters were not using the date handler of the individual fields.
-- Issue #1100934, Replace deprecated date_array() function.
-- #1096246 Date argument also was not applying the group method in the right place in the query, causing that method to be applied to all filters.
-- Missed a couple places when re-naming the get_value() function in the filter.
-- Fix more notices.
-- #1096246 Date filter was not apply the group method in the right place in the query, causing that method to be applied to all filters.
-- Fix undefined index notice.
-- Remove non-used function.
-- Issue #1082654 by arlinsandbulte: Remove master branch files and explain in readme.txt
-- Issue #906622 by bfroehle, Start cleanup of Date token code.
-- Fix typo in form processing.
-- Clean up the admin summary for the date filter.
-- Fix another use of get_value() in the filter.
-- Fix some strict errors in the views filter.
-- #1094408 by Boobaa: Date field not showing up in views arguments in localized site
-- #1041428, by tim.plunkett: Fix logic errors in 'All Day' computations.
-- #1054458: Move date_increment_round() function into Date API module so it is always available.
-- #745074, by rsevero: Don't test for valid timezone-adjusted date for dates that don't use time.
-- #1076992: The timezone element never got completely updated to D7.
-- #1013662 by developer-x: Remove check for start and end date - this prevented multiday-all day events from showing 'All Day'
+The date_filter_handler is an extension of the simple handler that allows you to
+combine multiple dates into a single filter so that you can control all of them
+with the same filter widget, allowing you to either 'OR' or 'AND' them together.
-======================
-Version 7.x-2.0-alpha1
-======================
+The arguments will be rewritten in the same way, with a simple argument handler
+for individual dates and another handler that extends that to control multiple
+dates with a single argument.
-- #1082658: Saving the options as arrays breaks other things. Add a custom export plugin instead.
-- #1082658, Views options need to be declared as arrays or they are not saved in the export in Views 3.
-- #1075896 Break out the code into the simple argument and a complex argument that combines date fields.
-- #1075890 Break out the code into the simple filter and a complex filter that combines date fields.
-
-======================
-Version 7.x-1.0-dev
-======================
-
-Abandoned the 7.x-1.x branch.
-
-Start a new 7.x-2.x branch that will contain a complete re-work of the Views handling.
-
-The 7.x-2.x branch will totally re-work and simplify the Views filters. These changes may/will
-break some views and will require that you check views that use the date filter or
-argument to be sure they are still configured correctly.
-
-There is a new date_filter_handler_simple for an individual date field that simplifies
-the Views handling by using most of the core Views field handling but adds in the
-possibility to set a default date using options like 'now', along with a choice of a
-month/day/year drop-down selector or popup calendar selector.
-
-The date_filter_handler is an extension of the simple handler that allows you to combine
-multiple dates into a single filter so that you can control all of them with the same
-filter widget, allowing you to either 'OR' or 'AND' them together.
-
-The arguments will be rewritten in the same way, with a simple argument handler for
-individual dates and another handler that extends that to control multiple dates with
-a single argument.
-
-- Add some error trapping in case the parent dateObject is unable to make a date out of a string to avoid showing the user errors.
-- #1027752 by B-Prod and dboulet, Fix missing table join on argument summary view.
-- #1047412 by das-peter - Using date filter in February causes "The day is invalid" error.
-- #1014162 Now that the datefield processing expands to date & time, the form_value is corrupted.
-- Changes to the data migration code to work with latest iteration of Content Migrate.
-
-======================
-Version 7.x-1.0-alpha2
-======================
-
-- Views made lots of changes to field handling just before the new release, which broke lots of things here.
-- Adding some work-arounds to get things working again and waiting until the dust settles on how the new core fields will be handled in Views before doing much more with the Views integration. These changes should get things working with latest Views release.
-
-======================
-Version 7.x-1.0-alpha1
-======================
-
-- Initial release, probably still buggy.
-- Remove Date PHP4, no longer needed because PHP4 is not supported any more.
-- Remove Date Timezone, now handled by core.
+#1082658 by KarenS: Saving the options as arrays breaks other things. Add a
+ custom export plugin instead.
+#1082658 by KarenS: Views options need to be declared as arrays or they are not
+ saved in the export in Views 3.
+#1075896 by KarenS: Break out the code into the simple argument and a complex
+ argument that combines date fields.
+#1075890 by KarenS: Break out the code into the simple filter and a complex
+ filter that combines date fields.
+By KarenS: Add some error trapping in case the parent dateObject is unable to
+ make a date out of a string to avoid showing the user errors.
+#1027752 by B-Prod and dboulet, Fix missing table join on argument summary
+ view.
+#1047412 by das-peter - Using date filter in February causes "The day is
+ invalid" error.
+#1014162 Now that the datefield processing expands to date & time, the
+ form_value is corrupted.
+By KarenS: Changes to the data migration code to work with latest iteration of
+ Content Migrate.
diff --git a/frontend/drupal/sites/all/modules/date/README.txt b/frontend/drupal/sites/all/modules/date/README.txt
index 75464988f..6fbdafb95 100644
--- a/frontend/drupal/sites/all/modules/date/README.txt
+++ b/frontend/drupal/sites/all/modules/date/README.txt
@@ -1,223 +1,73 @@
-INFORMATION FOR DEVELOPERS
+Date
+----
+The Date module suite provides an API for handling date values, a field for
+Drupal 7's Field API system, and a wealth of submodules for various purposes.
-Once the Date API is installed, all functions in the API are available to be
-used anywhere by any module.
+The following modules are included in the Date package, many of which have their
+own README.txt files with further information:
-The API uses the PHP 5.2 date functions to create and manipulate dates.
+* date_api/date_api.module:
+ A dependency for all of the other modules, provides a slew of APIs for the
+ other modules to leverage.
-Example, the following will create a date for the local value in one
-timezone, adjust it to a different timezone, then return the offset in seconds
-in the new timezone for the input date; The offset will be adjusted for both
-the timezone difference and daylight savings time, if necessary:
+* date.module:
+ Provides the Field API integration necessary to use date fields in the Drupal
+ 7 UI, or in custom modules.
-$date = date_create('2007-03-11 02:00:00', timezone_open('America/Chicago'));
-$chicago_time = date_format($date, 'Y-m-d H:i');
+* date_all_day/date_all_day.module:
+ Provides the option to add an 'All Day' checkbox to toggle time on and off
+ for date fields. It also contains the theme that displays the 'All Day' text
+ on fields that have no time.
-print 'At '. $chicago_time .' in Chicago, the timezone offset in seconds
- was '. date_offset_get($date);
+* date_context/date_context.module
+ Provides integration with the Context module [1], allowing the date to be used
+ as a condition on context definitions.
-date_timezone_set($date, timezone_open('Europe/Berlin');
-$berlin_time = date_format($date, 'Y-m-d H:i');
+* date_popup/date_popup.module
+ Adds a field widget for use with date and time fields that uses a jQuery-based
+ calendar-style date picker and timepicker.
-print 'It was '. $berlin_time .' in Berlin when it
- was '. $chicago_time .' in Chicago.';
-print 'At that time in Berlin, the timezone offset in seconds was
- '. date_offset_get($date);
+* date_repeat/date_repeat.module
+ Provides an API for calculating repeating dates and times from iCal rules.
-A helper class is available, new DateObject($string, $timezone, $format), where
-$string is a unixtimestamp, an ISO date, or a string like YYYY-MM-DD HH:MM:SS,
-$timezone is the name of the timezone this date is in, and $format is the format
-of date it is (DATE_FORMAT_UNIX, DATE_FORMAT_ISO, or DATE_FORMAT_DATETIME). It
-creates and return a date object set to the right date and timezone.
+* date_repeat/date_repeat_field.module
+ Creates the option of repeating date fields and manages Date fields that use
+ the Date Repeat API.
-Simpletest tests for these functions are included in the package.
+* date_tools/date_tools.module
+ Provides functionality for importing content with dates.
-Available functions include the following (more documentation is provided in
-the files):
+* date_views/date_views.module
+ Adds integration with the Views module [2] for adding date fields and filters
+ to views.
-============================================================================
-Preconfigured arrays
-============================================================================
-Both translated and untranslated values are available. The
-date_week_days_ordered() function will shift an array of week day names so it
-starts with the site's first day of the week, otherwise the weekday names start
-with Sunday as the first value, which is the expected order for many php and sql
-functions.
-date_month_names();
-date_month_names_abbr();
-date_month_names_untranslated();
-date_week_days();
-date_week_days_abbr();
-date_week_days_untranslated();
-date_week_days_ordered();
-date_years();
-date_hours();
-date_minutes();
-date_seconds();
-date_timezone_names();
-date_ampm();
+Credits / contact
+--------------------------------------------------------------------------------
+Currently maintained by Andrii Podanenko [3], Alex Schedrov [4], Damien McKenna
+[5] and Vijaya Chandran Mani [6]. Previous maintainers included Angie Byron
+[7], Arlin Sandbulte [8], David Goode [9], Derek Wright [10], developer-x [11]
+and Peter Lieverdink [12].
-============================================================================
-Miscellaneous date manipulation functions
-============================================================================
-Pre-defined constants and functions that will handle pre-1970 and post-2038
-dates in both PHP 4 and PHP 5, in any OS. Dates can be converted from one
-type to another and date parts can be extracted from any date type.
+Originally written and maintained by Karen Stevenson [13].
-DATE_DATETIME
-DATE_ISO
-DATE_UNIX
-DATE_ARRAY
-DATE_OBJECT
-DATE_ICAL
+The best way to contact the authors is to submit an issue, be it a support
+request, a feature request or a bug report, in the project issue queue:
+ https://www.drupal.org/project/issues/date
-date_convert()
-date_is_valid();
-date_part_is_valid();
-date_part_extract();
-============================================================================
-Date calculation and navigation
-============================================================================
-date_difference() will find the time difference between any two days, measured
-in seconds, minutes, hours, days, months, weeks, or years.
-
-date_days_in_month();
-date_days_in_year();
-date_weeks_in_year();
-date_last_day_of_month();
-date_day_of_week();
-date_day_of_week_name();
-date_difference();
-
-============================================================================
-Date regex and format helpers
-============================================================================
-Pre-defined constants, an array of date format strings and their
-equivalent regex strings.
-
-DATE_REGEX_LOOSE is a very loose regex that will pull date parts out
-of an ISO date with or without separators, using either 'T' or a space
-to separate date and time, and with or without time.
-
-date_format_date() is similar to format_date(), except it takes a
-date object instead of a timestamp as the first parameter.
-
-DATE_FORMAT_ISO
-DATE_FORMAT_DATETIME
-DATE_FORMAT_UNIX
-DATE_FORMAT_ICAL
-
-DATE_REGEX_ISO
-DATE_REGEX_DATETIME
-DATE_REGEX_LOOSE
-
-date_format_date();
-date_short_formats();
-date_medium_formats();
-date_long_formats();
-date_format_patterns();
-
-============================================================================
-Standardized ical parser and creator
-============================================================================
-The iCal parser is found in date_api_ical.inc, which is not included by default.
-Include that file if you want to use these functions:
-
-Complete rewrite of ical imports to parse vevents, vlocations, valarms,
-and all kinds of timezone options and repeat rules for ical imports.
-The function now sticks to parsing the ical into an array that can be used
-in various ways. It no longer trys to convert timezones while parsing,
-instead a date_ical_date_format() function is provided that can be used to
-convert from the ical timezone to whatever timezone is desired in the
-results. Repeat rules are parsed into an array which other modules can
-manipulate however they like to create additional events from the results.
-
-date_ical_export();
-date_ical_import();
-date_ical_date_format();
-
-============================================================================
-Helpers for portable date SQL
-============================================================================
-The SQL functions are found in date_api_sql.inc, which is not included by
-default. Include that file if you want to use these functions:
-
-date_sql();
-date_server_zone_adj();
-date_sql_concat();
-date_sql_pad();
-
-============================================================================
-Date forms and validators
-============================================================================
-Reusable, configurable, self-validating FAPI date elements are found in
-date_api_elements.inc, which is not included by default. Include it
-if you want to use these elements. To use them, create a form element
-and set the '#type' to one of the following:
-
-date_select
- The date_select element will create a collection of form elements, with a
- separate select or textfield for each date part. The whole collection will
- get reformatted back into a date value of the requested type during validation.
-
-date_text
- The date_text element will create a textfield that can contain a whole
- date or any part of a date as text. The user input value will be re-formatted
- back into a date value of the requested type during validation.
-
-date_timezone
- The date_timezone element will create a drop-down selector to pick a
- timezone name.
-
-The custom date elements require a few other pieces of information to work
-correctly, like #date_format and #date_type. See the internal documentation
-for more information.
-
-============================================================================
-Date Popup Module
-============================================================================
-
-A new module is included in the package that will enable a popup jQuery
-calendar date picker and timepicker in date and time fields.
-
-It is implemented as a custom form element, so set '#type' to 'date_popup'
-to use this element. See the internal documentation for more information.
-
-============================================================================
-Date Repeat API
-============================================================================
-
-An API for repeating dates is available if installed. It can be used by
-other modules to create a form element that will allow users to select
-repeat rules and store those selections in an iCal RRULE string, and a
-calculation function that will parse the RRULE and return an array of dates
-that match those rules. The API is implemented in the Date module as a
-new date widget if the Date Repeat API is installed.
-
-============================================================================
-RDF Integration
-============================================================================
-
-To make RDF easier to use, the base date themes (date_display_single and
-date_display_range) have been expanded so they pass attributes and
-RDF mappings for the field, if any, to the theme. If RDF is installed
-and no other mappings are provided, the theme adds RDF information
-to mark both the Start and End dates as 'xsd:dateTime' datatypes with the
-property of 'dc:date'. This occurs in the theme preprocess layer, in
-particular via the functions template_preprocess_date_display_single() and
-template_preprocess_date_display_range().
-
-To mark these as events instead, you could install the schemaorg
-module, which will load the schema.org vocabulary. The mark the content type
-that contains events as an 'Event', using the UI exposed by that
-module and set the event start date field with the 'dateStart'
-property and tag other fields in the content type with the appropriate
-property types. The Date module theme will wrap the start and end
-date output with appropriate markup.
-
-If the result is not quite what you need, you should be able to implement your
-own theme preprocess functions, e.g. MYTHEME_preprocess_date_display_single()
-or MYTHEME_preprocess_date_display_range() and alter the attributes to use the
-values you want.
+References
+--------------------------------------------------------------------------------
+1: https://www.drupal.org/project/context
+2: https://www.drupal.org/project/views
+3: https://www.drupal.org/u/podarok
+4: https://www.drupal.org/u/sanchiz
+5: https://www.drupal.org/u/damienmckenna
+6: https://www.drupal.org/u/vijaycs85
+7: https://www.drupal.org/u/webchick
+8: https://www.drupal.org/u/arlinsandbulte
+9: https://www.drupal.org/user/291318
+10: https://www.drupal.org/u/dww
+11: https://www.drupal.org/user/399625
+12: https://www.drupal.org/u/cafuego
+13: https://www.drupal.org/u/karens
diff --git a/frontend/drupal/sites/all/modules/date/date.api.php b/frontend/drupal/sites/all/modules/date/date.api.php
index 268ae868b..df3090ad8 100644
--- a/frontend/drupal/sites/all/modules/date/date.api.php
+++ b/frontend/drupal/sites/all/modules/date/date.api.php
@@ -40,7 +40,7 @@ function hook_date_default_argument_alter(&$argument, &$value) {
* - rdf_mapping: The RDF mapping array.
* - add_rdf: If module_exists('rdf').
*/
-function hook_date_formatter_pre_view_alter(&$entity, &$variables) {
+function hook_date_formatter_pre_view_alter(&$entity, array &$variables) {
if (!empty($entity->view)) {
$field = $variables['field'];
$date_id = 'date_id_' . $field['field_name'];
@@ -68,7 +68,7 @@ function hook_date_formatter_pre_view_alter(&$entity, &$variables) {
* - item: The $item array.
* - display: The $display array.
*/
-function hook_date_formatter_dates_alter(&$dates, $context) {
+function hook_date_formatter_dates_alter(array &$dates, array $context) {
$field = $context['field'];
$instance = $context['instance'];
$format = $context['format'];
@@ -90,7 +90,8 @@ function hook_date_formatter_dates_alter(&$dates, $context) {
'date2' => $date2,
'format' => $format,
'entity_type' => $entity_type,
- 'entity' => $entity));
+ 'entity' => $entity,
+ ));
$all_day2 = theme('date_all_day', array(
'field' => $field,
'instance' => $instance,
@@ -99,7 +100,8 @@ function hook_date_formatter_dates_alter(&$dates, $context) {
'date2' => $date2,
'format' => $format,
'entity_type' => $entity_type,
- 'entity' => $entity));
+ 'entity' => $entity,
+ ));
$dates['value']['formatted_time'] = theme('date_all_day_label');
$dates['value2']['formatted_time'] = theme('date_all_day_label');
$dates['value']['formatted'] = $all_day1;
@@ -117,7 +119,7 @@ function hook_date_formatter_dates_alter(&$dates, $context) {
* @param array $input
* The array of input values to be validated.
*/
-function hook_date_text_pre_validate_alter(&$element, &$form_state, &$input) {
+function hook_date_text_pre_validate_alter(array &$element, array &$form_state, array &$input) {
// Let Date module massage the format for all day values so they will pass
// validation. The All day flag, if used, actually exists on the parent
// element.
@@ -134,7 +136,7 @@ function hook_date_text_pre_validate_alter(&$element, &$form_state, &$input) {
* @param array $input
* The array of input values to be validated.
*/
-function hook_date_select_pre_validate_alter(&$element, &$form_state, &$input) {
+function hook_date_select_pre_validate_alter(array &$element, array &$form_state, array &$input) {
// Let Date module massage the format for all day values so they will pass
// validation. The All day flag, if used, actually exists on the parent
// element.
@@ -151,7 +153,7 @@ function hook_date_select_pre_validate_alter(&$element, &$form_state, &$input) {
* @param array $input
* The array of input values to be validated.
*/
-function hook_date_popup_pre_validate_alter(&$element, &$form_state, &$input) {
+function hook_date_popup_pre_validate_alter(array &$element, array &$form_state, array &$input) {
// Let Date module massage the format for all day values so they will pass
// validation. The All day flag, if used, actually exists on the parent
// element.
@@ -173,9 +175,8 @@ function hook_date_popup_pre_validate_alter(&$element, &$form_state, &$input) {
*
* @see date_combo_element_process()
*/
-function hook_date_combo_pre_validate_alter(&$element, &$form_state, $context) {
+function hook_date_combo_pre_validate_alter(array &$element, array &$form_state, array $context) {
if (!empty($context['item']['all_day'])) {
-
$field = $context['field'];
// If we have an all day flag on this date and the time is empty, change the
@@ -200,12 +201,12 @@ function hook_date_combo_pre_validate_alter(&$element, &$form_state, $context) {
* A keyed array containing the current state of the form.
* @param array $context
* An associative array containing the following keys:
- * - field: The $field array.
- * - instance: The $instance array.
- * - item: The $item array.
- * - element: The $element array.
+ * - field: The $field array.
+ * - instance: The $instance array.
+ * - item: The $item array.
+ * - element: The $element array.
*/
-function hook_date_combo_validate_date_start_alter(&$date, &$form_state, $context) {
+function hook_date_combo_validate_date_start_alter(object &$date, array &$form_state, array $context) {
// If this is an 'All day' value, set the time to midnight.
if (!empty($context['element']['#date_is_all_day'])) {
$date->setTime(0, 0, 0);
@@ -224,12 +225,12 @@ function hook_date_combo_validate_date_start_alter(&$date, &$form_state, $contex
* A keyed array containing the current state of the form.
* @param array $context
* An associative array containing the following keys:
- * - field: The $field array.
- * - instance: The $instance array.
- * - item: The $item array.
- * - element: The $element array.
+ * - field: The $field array.
+ * - instance: The $instance array.
+ * - item: The $item array.
+ * - element: The $element array.
*/
-function hook_date_combo_validate_date_end_alter(&$date, &$form_state, $context) {
+function hook_date_combo_validate_date_end_alter(object &$date, array &$form_state, array $context) {
// If this is an 'All day' value, set the time to midnight.
if (!empty($context['element']['#date_is_all_day'])) {
$date->setTime(0, 0, 0);
@@ -249,7 +250,7 @@ function hook_date_combo_validate_date_end_alter(&$date, &$form_state, $context)
*
* @see date_text_element_process()
*/
-function hook_date_text_process_alter(&$element, &$form_state, $context) {
+function hook_date_text_process_alter(array &$element, array &$form_state, array $context) {
$all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
if ($all_day_id != '') {
// All Day handling on text dates works only if the user leaves the time out
@@ -270,7 +271,7 @@ function hook_date_text_process_alter(&$element, &$form_state, $context) {
*
* @see date_select_element_process()
*/
-function hook_date_select_process_alter(&$element, &$form_state, $context) {
+function hook_date_select_process_alter(array &$element, array &$form_state, array $context) {
// Hide or show the element in reaction to the all_day status for the element.
$all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
if ($all_day_id != '') {
@@ -299,7 +300,7 @@ function hook_date_select_process_alter(&$element, &$form_state, $context) {
*
* @see date_popup_element_process()
*/
-function hook_date_popup_process_alter(&$element, &$form_state, $context) {
+function hook_date_popup_process_alter(array &$element, array &$form_state, array $context) {
// Hide or show the element in reaction to the all_day status for the element.
$all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
if ($all_day_id != '' && array_key_exists('time', $element)) {
@@ -324,7 +325,7 @@ function hook_date_popup_process_alter(&$element, &$form_state, $context) {
* - instance: The $instance array.
* - form: Nested array of form elements that comprise the form.
*/
-function hook_date_combo_process_alter(&$element, &$form_state, $context) {
+function hook_date_combo_process_alter(array &$element, array &$form_state, array $context) {
$field = $context['field'];
$instance = $context['instance'];
$field_name = $element['#field_name'];
@@ -365,7 +366,7 @@ function hook_date_combo_process_alter(&$element, &$form_state, $context) {
*
* @see date_timezone_element_process()
*/
-function hook_date_timezone_process_alter(&$element, &$form_state, $context) {
+function hook_date_timezone_process_alter(array &$element, array &$form_state, array $context) {
// @todo.
}
@@ -382,7 +383,7 @@ function hook_date_timezone_process_alter(&$element, &$form_state, $context) {
*
* @see date_year_range_element_process()
*/
-function hook_date_year_range_process_alter(&$element, &$form_state, $context) {
+function hook_date_year_range_process_alter(array &$element, array &$form_state, array $context) {
// @todo.
}
@@ -399,7 +400,7 @@ function hook_date_year_range_process_alter(&$element, &$form_state, $context) {
*
* @see hook_field_settings_form()
*/
-function hook_date_field_settings_form_alter(&$form, $context) {
+function hook_date_field_settings_form_alter(array &$form, array $context) {
$field = $context['field'];
$instance = $context['instance'];
$has_data = $context['has_data'];
@@ -427,7 +428,7 @@ function hook_date_field_settings_form_alter(&$form, $context) {
*
* @see hook_field_instance_settings_form()
*/
-function hook_date_field_instance_settings_form_alter(&$form, $context) {
+function hook_date_field_instance_settings_form_alter(array &$form, array $context) {
$field = $context['field'];
$instance = $context['instance'];
$form['new_setting'] = array(
@@ -449,7 +450,7 @@ function hook_date_field_instance_settings_form_alter(&$form, $context) {
*
* @see hook_field_widget_settings_form()
*/
-function hook_date_field_widget_settings_form_alter(&$form, $context) {
+function hook_date_field_widget_settings_form_alter(array &$form, array $context) {
$field = $context['field'];
$instance = $context['instance'];
$form['new_setting'] = array(
@@ -474,7 +475,7 @@ function hook_date_field_widget_settings_form_alter(&$form, $context) {
*
* @see hook_field_formatter_settings_form()
*/
-function hook_date_field_formatter_settings_form_alter(&$form, &$form_state, $context) {
+function hook_date_field_formatter_settings_form_alter(array &$form, array &$form_state, array $context) {
$field = $context['field'];
$instance = $context['instance'];
$view_mode = $context['view_mode'];
@@ -486,7 +487,8 @@ function hook_date_field_formatter_settings_form_alter(&$form, &$form_state, $co
'#type' => 'select',
'#options' => array(
'show' => t('Show repeat rule'),
- 'hide' => t('Hide repeat rule')),
+ 'hide' => t('Hide repeat rule'),
+ ),
'#default_value' => $settings['show_repeat_rule'],
'#access' => $field['settings']['repeat'],
'#weight' => 5,
@@ -508,7 +510,7 @@ function hook_date_field_formatter_settings_form_alter(&$form, &$form_state, $co
*
* @see hook_field_formatter_settings_summary()
*/
-function hook_date_field_formatter_settings_summary_alter(&$summary, $context) {
+function hook_date_field_formatter_settings_summary_alter(array &$summary, array $context) {
$field = $context['field'];
$instance = $context['instance'];
$view_mode = $context['view_mode'];
diff --git a/frontend/drupal/sites/all/modules/date/date.devel_generate.inc b/frontend/drupal/sites/all/modules/date/date.devel_generate.inc
index 6c61e23cf..d6e2433c4 100644
--- a/frontend/drupal/sites/all/modules/date/date.devel_generate.inc
+++ b/frontend/drupal/sites/all/modules/date/date.devel_generate.inc
@@ -7,22 +7,15 @@
/**
* Implements hook_devel_generate().
- *
- * Included only when needed.
*/
function date_devel_generate($entity, $field, $instance, $bundle) {
-
$entity_field = array();
if (isset($instance['widget']['settings']['year_range'])) {
$split = explode(':', $instance['widget']['settings']['year_range']);
// Determine how much to go back and forward depending on whether a relative
// number of years (with - or + sign) or an absolute year is given.
- $back = strpos($split[0], '-') === 0
- ? str_replace('-', '', $split[0])
- : date_format(date_now(), 'Y') - $split[0];
- $forward = strpos($split[1], '+') === 0
- ? str_replace('+', '', $split[1])
- : $split[1] - date_format(date_now(), 'Y');
+ $back = $split[0];
+ $forward = $split[1];
}
else {
$back = 2;
@@ -30,7 +23,8 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
}
// Pick a random year within the time range,
// and a random second within that year.
- $year = date_format(date_now(), 'Y') - $back + mt_rand(0, ($forward + $back));
+ $this_year = date_format(date_now(), 'Y');
+ $year = mt_rand($this_year + $back, $this_year + $forward);
$start = new DateObject($year . '-01-01 00:00:00', date_get_timezone_db($field['settings']['tz_handling']));
$leap = date_format($start, 'L');
$max_days = $leap ? 366 : 365;
@@ -39,17 +33,16 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
$increment = $instance['widget']['settings']['increment'];
date_increment_round($start, $increment);
- // Modify End date by 1 hour to 3 days, shorter for repeating dates
- // longer for others.
- $start2 = clone($start);
+ // Modify End date by 1 hour to 3 days, shorter for repeating dates longer
+ // for others.
+ $start2 = clone $start;
$max = !empty($field['settings']['repeat']) ? 720 : 4320;
$max = 240;
date_modify($start2, '+' . mt_rand(60, $max) . ' minutes');
date_increment_round($start2, $increment);
if ($field['settings']['tz_handling'] == 'date') {
- // Choose a random timezone.
- // Not all keys exist, so we have to check.
+ // Choose a random timezone. Not all keys exist, so we have to check.
$timezones = array_keys(date_timezone_names(TRUE));
$key = mt_rand(0, count($timezones) - 1);
if (!array_key_exists($key, $timezones)) {
@@ -86,5 +79,4 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
date_timezone_set($start2, timezone_open($timezone));
$entity_field['offset2'] = date_offset_get($start2);
return $entity_field;
-
}
diff --git a/frontend/drupal/sites/all/modules/date/date.diff.inc b/frontend/drupal/sites/all/modules/date/date.diff.inc
index e46d3a1f9..843f2a728 100644
--- a/frontend/drupal/sites/all/modules/date/date.diff.inc
+++ b/frontend/drupal/sites/all/modules/date/date.diff.inc
@@ -32,7 +32,6 @@ function date_field_diff_view($items, $context) {
case 'value2':
$diff_items[$delta] = $date[$display['settings']['fromto']]['formatted'];
break;
-
}
}
return $diff_items;
diff --git a/frontend/drupal/sites/all/modules/date/date.field.inc b/frontend/drupal/sites/all/modules/date/date.field.inc
index 7aef97bee..275caf8c0 100644
--- a/frontend/drupal/sites/all/modules/date/date.field.inc
+++ b/frontend/drupal/sites/all/modules/date/date.field.inc
@@ -15,10 +15,11 @@ function date_field_formatter_info() {
'field types' => array('date', 'datestamp', 'datetime'),
'settings' => array(
'format_type' => 'long',
+ 'custom_date_format' => '',
+ 'fromto' => 'both',
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
- 'fromto' => 'both',
'show_remaining_days' => FALSE,
),
),
@@ -28,7 +29,7 @@ function date_field_formatter_info() {
'settings' => array(
'interval' => 2,
'interval_display' => 'time ago',
- 'use_end_date' => false,
+ 'use_end_date' => FALSE,
),
),
'date_plain' => array(
@@ -53,7 +54,6 @@ function date_field_formatter_settings_form($field, $instance, $view_mode, $form
default:
$form = date_default_formatter_settings_form($field, $instance, $view_mode, $form, $form_state);
- break;
}
$context = array(
'field' => $field,
@@ -78,7 +78,6 @@ function date_field_formatter_settings_summary($field, $instance, $view_mode) {
default:
$summary = date_default_formatter_settings_summary($field, $instance, $view_mode);
- break;
}
$context = array(
'field' => $field,
@@ -92,28 +91,24 @@ function date_field_formatter_settings_summary($field, $instance, $view_mode) {
/**
* Implements hook_field_formatter_view().
- *
- * Useful values:
- *
- * $entity->date_id
- * If set, this will show only an individual date on a field with
- * multiple dates. The value should be a string that contains
- * the following values, separated with periods:
- * - module name of the module adding the item
- * - node nid
- * - field name
- * - delta value of the field to be displayed
- * - other information the module's custom theme might need
- *
- * Used by the calendar module and available for other uses.
- * example: 'date:217:field_date:3:test'
- *
- * $entity->date_repeat_show
- * If true, tells the theme to show all the computed values
- * of a repeating date. If not true or not set, only the
- * start date and the repeat rule will be displayed.
*/
function date_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
+ // Useful values:
+ // - $entity->date_id
+ // If set, this will show only an individual date on a field with
+ // multiple dates. The value should be a string that contains
+ // the following values, separated with periods:
+ // - module name of the module adding the item
+ // - node nid
+ // - field name
+ // - delta value of the field to be displayed
+ // - other information the module's custom theme might need
+ // Used by the calendar module and available for other uses.
+ // example: 'date:217:field_date:3:test'
+ // - $entity->date_repeat_show
+ // If TRUE, tells the theme to show all the computed values
+ // of a repeating date. If not TRUE or not set, only the
+ // start date and the repeat rule will be displayed.
$element = array();
$settings = $display['settings'];
$formatter = $display['type'];
@@ -176,8 +171,9 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la
$element[$delta] = array(
'#markup' => t('!start-date to !end-date', array(
'!start-date' => $item['value'],
- '!end-date' => $item['value2']
- )));
+ '!end-date' => $item['value2'],
+ )),
+ );
}
}
}
@@ -215,8 +211,13 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la
}
}
}
- break;
}
+
+ // Add the CSS stylesheet only if we have something to display.
+ if (!empty($element)) {
+ $element['#attached']['css'][] = drupal_get_path('module', 'date_api') . '/date.css';
+ }
+
return $element;
}
@@ -224,8 +225,7 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la
* Implements hook_field_is_empty().
*/
function date_field_is_empty($item, $field) {
- // Sometimes a $item is a date object.
- // Coming from repeating dates. Why??
+ // Sometimes a $item is a date object. Coming from repeating dates. Why??
if (!is_array($item)) {
return FALSE;
}
@@ -373,12 +373,13 @@ function date_field_validate($entity_type, $entity, $field, $instance, $langcode
foreach ($items as $delta => $item) {
if (is_array($item) && isset($item['value'])) {
$process = date_process_values($field, $instance);
- $date1 = new DateObject($item['value'], $item['timezone'], date_type_format($field['type']));
- if (count($process) == 1 || (empty($item['value2']) && $item['value2'] !== 0)) {
- $date2 = clone($date1);
+ $timezone = date_get_timezone($field['settings']['tz_handling'], isset($item['timezone']) ? $item['timezone'] : '');
+ $date1 = new DateObject($item['value'], $timezone, date_type_format($field['type']));
+ if (count($process) === 1 || (empty($item['value2']) && $item['value2'] !== 0)) {
+ $date2 = clone $date1;
}
else {
- $date2 = new DateObject($item['value2'], $item['timezone'], date_type_format($field['type']));
+ $date2 = new DateObject($item['value2'], $timezone, date_type_format($field['type']));
}
$valid1 = $date1->validGranularity($field['settings']['granularity'], $flexible);
$valid2 = $date2->validGranularity($field['settings']['granularity'], $flexible);
@@ -411,6 +412,7 @@ function date_field_presave($entity_type, $entity, $field, $instance, $langcode,
if (empty($items)) {
return;
}
+
// Add some information needed to interpret token values.
$values = $items;
foreach ($values as $delta => $item) {
@@ -454,11 +456,10 @@ function date_field_update($entity_type, $entity, $field, $instance, $langcode,
/**
* Implements hook_field_instance_settings_form().
- *
- * Wrapper functions for date administration, included only when processing
- * field settings.
*/
function date_field_instance_settings_form($field, $instance) {
+ // Wrapper functions for date administration, included only when processing
+ // field settings.
module_load_include('inc', 'date', 'date_admin');
return _date_field_instance_settings_form($field, $instance);
}
@@ -505,15 +506,14 @@ function date_field_settings_validate(&$form, &$form_state) {
/**
* Implements hook_content_migrate_field_alter().
- *
- * Use this to tweak the conversion of field settings from the D6 style to the
- * D7 style for specific situations not handled by basic conversion, as when
- * field types or settings are changed.
- *
- * $field_value['widget_type'] is available to see what widget type was
- * originally used.
*/
function date_content_migrate_field_alter(&$field_value, $instance_value) {
+ // Use this to tweak the conversion of field settings from the D6 style to the
+ // D7 style for specific situations not handled by basic conversion, as when
+ // field types or settings are changed.
+ //
+ // $field_value['widget_type'] is available to see what widget type was
+ // originally used.
switch ($field_value['module']) {
case 'date':
// Those settings do not exist anymore, or have been moved to the instance
@@ -526,15 +526,13 @@ function date_content_migrate_field_alter(&$field_value, $instance_value) {
/**
* Implements hook_content_migrate_instance_alter().
- *
- * Use this to tweak the conversion of instance or widget settings from the D6
- * style to the D7 style for specific situations not handled by basic
- * conversion, as when formatter or widget names or settings are changed.
*/
function date_content_migrate_instance_alter(&$instance_value, $field_value) {
+ // Use this to tweak the conversion of instance or widget settings from the D6
+ // style to the D7 style for specific situations not handled by basic
+ // conversion, as when formatter or widget names or settings are changed.
switch ($instance_value['widget']['module']) {
case 'date':
-
// Some settings have been moved from field to instance.
$instance_value['widget']['settings']['repeat_collapsed'] = $field_value['settings']['repeat_collapsed'];
diff --git a/frontend/drupal/sites/all/modules/date/date.info b/frontend/drupal/sites/all/modules/date/date.info
index 28263b420..7b913f223 100644
--- a/frontend/drupal/sites/all/modules/date/date.info
+++ b/frontend/drupal/sites/all/modules/date/date.info
@@ -1,23 +1,33 @@
name = Date
description = Makes date/time fields available.
-dependencies[] = date_api
+dependencies[] = date:date_api
package = Date/Time
core = 7.x
-php = 5.2
-files[] = date.migrate.inc
-files[] = tests/date_api.test
-files[] = tests/date.test
-files[] = tests/date_field.test
-files[] = tests/date_migrate.test
-files[] = tests/date_validation.test
-files[] = tests/date_timezone.test
-files[] = tests/date_views_pager.test
-files[] = tests/date_views_popup.test
-files[] = tests/date_form.test
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Integration with the migrate module.
+files[] = date.migrate.inc
+
+; Dependencies for test coverage.
+test_dependencies[] = entity:entity
+test_dependencies[] = features:features (2.x)
+test_dependencies[] = migrate:migrate
+test_dependencies[] = views:views
+
+; Test coverage: standalone tests.
+files[] = tests/DateEmwTestCase.test
+files[] = tests/DateFormTestCase.test
+files[] = tests/DateMigrateTestCase.test
+files[] = tests/DateNowUnitTestCase.test
+
+; The remaining tests depend upon this one.
+files[] = tests/DateFieldTestBase.test
+files[] = tests/DateFieldTestCase.test
+files[] = tests/DateTimezoneTestCase.test
+files[] = tests/DateUiTestCase.test
+files[] = tests/DateValidationTestCase.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
core = "7.x"
project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/frontend/drupal/sites/all/modules/date/date.install b/frontend/drupal/sites/all/modules/date/date.install
index 765b90cf8..a75b1ca3c 100644
--- a/frontend/drupal/sites/all/modules/date/date.install
+++ b/frontend/drupal/sites/all/modules/date/date.install
@@ -14,6 +14,7 @@ function date_field_schema($field) {
case 'datestamp':
$db_columns['value'] = array(
'type' => 'int',
+ 'size' => 'big',
'not null' => FALSE,
'sortable' => TRUE,
'views' => TRUE,
@@ -41,7 +42,6 @@ function date_field_schema($field) {
'sortable' => TRUE,
'views' => TRUE,
);
- break;
}
// If a second date is needed for 'End date', make a copy of the first one.
@@ -51,6 +51,16 @@ function date_field_schema($field) {
// 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;
+
+ // Create a compound index on value and value2 and an index on value2.
+ $indexes = array(
+ 'value' => array('value', 'value2'),
+ 'value2' => array('value2'),
+ );
+ }
+ else {
+ // Otherwise just an index on value.
+ $indexes = array('value' => array('value'));
}
// Timezone and offset columns are used only if date-specific dates are used.
if (isset($field['settings']['tz_handling']) && $field['settings']['tz_handling'] == 'date') {
@@ -72,7 +82,7 @@ function date_field_schema($field) {
'type' => 'int',
'not null' => FALSE,
'sortable' => TRUE,
- 'views' => FALSE
+ 'views' => FALSE,
);
}
}
@@ -84,7 +94,7 @@ function date_field_schema($field) {
'views' => FALSE,
);
}
- return array('columns' => $db_columns);
+ return array('columns' => $db_columns, 'indexes' => $indexes);
}
/**
@@ -134,13 +144,14 @@ function date_update_7001() {
$query->condition(db_or()->condition('fc.type', 'date')->condition('fc.type', 'datestamp')->condition('fc.type', 'datetime'));
$results = $query->execute();
+ $allowed_types = array(
+ 'date_popup_repeat',
+ 'date_text_repeat',
+ 'date_select_repeat',
+ );
foreach ($results as $record) {
$instance = unserialize($record['data']);
- if (in_array($instance['widget']['type'], array(
- 'date_popup_repeat',
- 'date_text_repeat',
- 'date_select_repeat'
- ))) {
+ if (in_array($instance['widget']['type'], $allowed_types)) {
$instance['widget']['type'] = str_replace('_repeat', '', $instance['widget']['type']);
db_update('field_config_instance')
->fields(array(
@@ -212,3 +223,93 @@ function date_update_7005() {
// @see https://www.drupal.org/node/1355256
date_update_7004();
}
+
+/**
+ * Add date value indexes to existed field tables.
+ */
+function date_update_7006() {
+ // Get all fields provided by the Data module.
+ $query = db_select('field_config', 'f')
+ ->fields('f', array('id', 'field_name', 'data'))
+ ->condition('f.type', array('datetime', 'date', 'datestamp'));
+
+ // Special handling for the Encrypt module.
+ if (module_exists('field_encrypt')) {
+ $query->condition('f.data', '%' . db_like(' field_encrypt";a:1:{s:7:"encrypt";i:0 ') . '%', 'LIKE');
+ }
+
+ // Complete the query.
+ $fields = $query->execute()->fetchAllAssoc('id');
+
+ foreach ($fields as $id => $info) {
+ $field_info = field_info_field($info->field_name);
+
+ // Add indexes only for SQL storage fields.
+ if ($field_info['storage']['type'] != 'field_sql_storage') {
+ continue;
+ }
+
+ $tables = array(
+ key($field_info['storage']['details']['sql']['FIELD_LOAD_CURRENT']),
+ key($field_info['storage']['details']['sql']['FIELD_LOAD_REVISION']),
+ );
+
+ $data = unserialize($info->data);
+ $field_name = $info->field_name . '_value';
+ $field_name2 = $info->field_name . '_value2';
+
+ // Build indexes.
+ $indexes = $data['indexes'] = array();
+ if (!empty($data['settings']['todate'])) {
+ $indexes[$field_name] = array($field_name, $field_name2);
+ $indexes[$field_name2] = array($field_name2);
+ $data['indexes']['value'] = array('value', 'value2');
+ $data['indexes']['value2'] = array('value2');
+ }
+ else {
+ $indexes[$field_name] = array($field_name);
+ $data['indexes']['value'] = array('value');
+ }
+
+ // Add missed indexes to tables.
+ foreach ($indexes as $name => $index) {
+ foreach ($tables as $table) {
+ if (!db_index_exists($table, $name)) {
+ db_add_index($table, $name, $index);
+ }
+ }
+ }
+
+ // Fix date fields storage 'field_config' indexes.
+ db_update('field_config')
+ ->fields(array('data' => serialize($data)))
+ ->condition('id', $id)
+ ->execute();
+ }
+}
+
+/**
+ * Update datestamp field schema to use 'big' integers.
+ */
+function date_update_7007() {
+ $fields = field_read_fields(array('type' => 'datestamp'));
+ foreach ($fields as $field_name => $field) {
+ foreach (array_intersect_key($field['columns'], drupal_map_assoc(array('value', 'value2'))) as $column_name => $schema) {
+ $schema['size'] = 'big';
+ $column = $field_name . '_' . $column_name;
+ if (db_table_exists('field_data_' . $field_name)) {
+ db_change_field('field_data_' . $field_name, $column, $column, $schema);
+ }
+ if (db_table_exists('field_revision_' . $field_name)) {
+ db_change_field('field_revision_' . $field_name, $column, $column, $schema);
+ }
+ }
+ }
+}
+
+/**
+ * The date_migrate_example module was renamed.
+ */
+function date_update_7200() {
+ db_delete('system')->condition('name', 'date_migrate_example')->execute();
+}
diff --git a/frontend/drupal/sites/all/modules/date/date.migrate.inc b/frontend/drupal/sites/all/modules/date/date.migrate.inc
index 90c1ec51f..dc95c9ff3 100644
--- a/frontend/drupal/sites/all/modules/date/date.migrate.inc
+++ b/frontend/drupal/sites/all/modules/date/date.migrate.inc
@@ -1,4 +1,5 @@
2,
- 'field handlers' => array('DateMigrateFieldHandler'),
- );
- return $api;
-}
-
class DateMigrateFieldHandler extends MigrateFieldHandler {
/**
@@ -112,7 +105,7 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
// Legacy support for JSON containing a set of properties - deprecated
// now that we have subfields.
- if (!empty($from) && $from{0} == '{') {
+ if (!empty($from) && $from[0] == '{') {
$properties = drupal_json_decode($from);
$from = $properties['from'];
// Properties passed in with the date override any set via arguments.
@@ -127,9 +120,8 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
}
}
- // Missing data? Create an empty value and return;
- // Don't try to turn the empty value into a bogus
- // timestamp for 'now'.
+ // Missing data? Create an empty value and return; Don't try to turn the
+ // empty value into a bogus timestamp for 'now'.
if (empty($from)) {
$return[$language][$delta]['value'] = NULL;
$return[$language][$delta]['timezone'] = NULL;
@@ -171,9 +163,6 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
$to = format_date($to, 'custom', 'Y-m-d\TH:i:s', $timezone);
}
break;
-
- default:
- break;
}
// Handle repeats, coming in as RRULEs. Many field instances may be
@@ -212,4 +201,5 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
'to' => t('End date date'),
);
}
+
}
diff --git a/frontend/drupal/sites/all/modules/date/date.module b/frontend/drupal/sites/all/modules/date/date.module
index e667b5ddf..005ebab35 100644
--- a/frontend/drupal/sites/all/modules/date/date.module
+++ b/frontend/drupal/sites/all/modules/date/date.module
@@ -20,8 +20,8 @@ function date_get_entity_bundle($entity_type, $entity) {
default:
$bundle = field_extract_bundle($entity_type, $entity);
- break;
}
+
// If there is no bundle name, field_info() uses the entity name as the bundle
// name in its arrays.
if (empty($bundle)) {
@@ -157,7 +157,7 @@ function date_theme() {
/**
* Implements hook_element_info().
*
- * date_combo will create a 'start' and optional 'end' date, along with
+ * Date_combo will create a 'start' and optional 'end' date, along with
* an optional 'timezone' column for date-specific timezones. Each
* 'start' and 'end' date will be constructed from date_select or date_text.
*/
@@ -170,6 +170,9 @@ function date_element_info() {
'#process' => array('date_combo_element_process'),
'#element_validate' => array('date_combo_validate'),
'#theme_wrappers' => array('date_combo'),
+ '#attached' => array('css' => array(
+ drupal_get_path('module', 'date_api') . '/date.css',
+ )),
);
if (module_exists('ctools')) {
$type['date_combo']['#pre_render'] = array('ctools_dependent_pre_render');
@@ -185,7 +188,7 @@ function date_element_info() {
* @param string $formatter
* The date formatter.
* @param string $entity_type
- * The entity_type for the instance
+ * The entity_type for the instance.
* @param object $entity
* The entity object.
* @param array $field
@@ -215,7 +218,7 @@ function date_element_info() {
* )
* )
*/
-function date_formatter_process($formatter, $entity_type, $entity, $field, $instance, $langcode, $item, $display) {
+function date_formatter_process($formatter, $entity_type, $entity, array $field, array $instance, $langcode, array $item, array $display) {
$dates = array();
$timezone = date_default_timezone();
if (empty($timezone)) {
@@ -338,12 +341,12 @@ function _get_custom_date_format($date, $format) {
* $field['settings']['granularity'] will contain an array like
* ('hour' => 'hour', 'month' => 0) where the values turned on return their own
* names and the values turned off return a zero need to reconfigure this into
- * simple array of the turned on values
+ * simple array of the turned on values.
*
* @param array $field
* The field array.
*/
-function date_granularity($field) {
+function date_granularity(array $field) {
if (!is_array($field) || !is_array($field['settings']['granularity'])) {
$granularity = drupal_map_assoc(array('year', 'month', 'day'));
$field['settings']['granularity'] = $granularity;
@@ -352,9 +355,15 @@ function date_granularity($field) {
}
/**
- * Helper function to create an array of the date values in a field that need to be processed.
+ * Create an array of the date values in a field that need to be processed.
+ *
+ * @param array $field
+ * The field being processed.
+ *
+ * @return array
+ * The date values which need to be processed.
*/
-function date_process_values($field) {
+function date_process_values(array $field) {
return $field['settings']['todate'] ? array('value', 'value2') : array('value');
}
@@ -449,7 +458,6 @@ function date_formatter_format($formatter, $settings, $granularity = array(), $l
else {
$format = date_format_type_format($format_type, $langcode);
}
- break;
}
// A selected format might include timezone information.
@@ -471,7 +479,7 @@ function date_format_type_format($format_type, $langcode = NULL) {
// we receive (due to inconsistency of core api) an array of all (other)
// formats available for $langcode in locale table.
// However there's no guarantee that the key $format_type exists.
- // See http://drupal.org/node/1302358.
+ // @see http://drupal.org/node/1302358
if (!is_string($format)) {
// If the configuration page at admin/config/regional/date-time was
// never saved, the default core date format variables
@@ -493,19 +501,17 @@ function date_format_type_format($format_type, $langcode = NULL) {
case 'medium':
default:
// @todo: If a non-core module provides a date type and does not
- // variable_set() a default for it, the default assumed here may
- // not be correct (since the default format used by 'medium' may
- // not even be one of the allowed formats for the date type in
- // question). To fix this properly, we should really call
- // system_get_date_formats($format_type) and take the first
- // format from that list as the default. However, this function
- // is called often (on many different page requests), so calling
+ // variable_set() a default for it, the default assumed here may not
+ // be correct (since the default format used by 'medium' may not even
+ // be one of the allowed formats for the date type in question). To
+ // fix this properly, we should really call
+ // system_get_date_formats($format_type) and take the first format
+ // from that list as the default. However, this function is called
+ // often (on many different page requests), so calling
// system_get_date_formats() from here would be a performance hit
- // since that function writes several records to the database
- // during each page request that calls it.
+ // since that function writes several records to the database during
+ // each page request that calls it.
$default = 'D, m/d/Y - H:i';
- break;
-
}
$format = variable_get('date_format_' . $format_type, $default);
}
@@ -656,7 +662,7 @@ function date_entity_metadata_struct_getter($item, array $options, $name, $type,
return NULL;
}
- $timezone_db = !empty($item['timezone_db']) ? $item['timezone_db'] : 'UTC';
+ $timezone_db = date_get_timezone_db($info['field']['settings']['tz_handling']);
$date = new DateObject($value, $timezone_db);
return !empty($date) ? date_format_date($date, 'custom', 'U') : NULL;
}
@@ -714,7 +720,8 @@ function date_entity_metadata_struct_create($name, $property_info) {
*
* Based on entity_property_verbatim_set().
*
- * The passed in unix timestamp (UTC) is converted to the right value and format dependent on the field.
+ * The passed in unix timestamp (UTC) is converted to the right value and format
+ * dependent on the field.
*
* $name is either 'value' or 'value2'.
*/
@@ -736,25 +743,37 @@ function date_entity_metadata_struct_setter(&$item, $name, $value, $langcode, $t
}
/**
- * Duplicate functionality of what is now date_all_day_field() in the Date All Day module.
+ * Duplicate of what is now date_all_day_field() in the Date All Day module.
*
- * Copy left here to avoid breaking other modules that use this function.
+ * Left here to avoid breaking other modules that use this function.
*
- * DEPRECATED!, will be removed at some time in the future.
+ * DEPRECATED! Will be removed at some time in the future.
*/
function date_field_all_day($field, $instance, $date1, $date2 = NULL) {
if (empty($date1) || !is_object($date1)) {
return FALSE;
}
elseif (!date_has_time($field['settings']['granularity'])) {
- return TRUE;
+ return FALSE;
}
+ // The master setting for the 'all day' functionality.
+ elseif (empty($instance['settings']['widget']['settings']['display_all_day'])) {
+ return FALSE;
+ }
+
if (empty($date2)) {
$date2 = $date1;
}
+ // Use central logic for determining the granularity.
$granularity = date_granularity_precision($field['settings']['granularity']);
- $increment = isset($instance['widget']['settings']['increment']) ? $instance['widget']['settings']['increment'] : 1;
+
+ // The increment is 1 by default, but it can be overridden.
+ $increment = 1;
+ if (isset($instance['widget']['settings']['increment'])) {
+ $increment = $instance['widget']['settings']['increment'];
+ }
+
return date_is_all_day(date_format($date1, DATE_FORMAT_DATETIME), date_format($date2, DATE_FORMAT_DATETIME), $granularity, $increment);
}
@@ -771,7 +790,7 @@ function date_field_all_day($field, $instance, $date1, $date2 = NULL) {
*
* DEPRECATED!, will be removed at some time in the future.
*/
-function date_field_get_sql_handler($field, $compare_tz = NULL) {
+function date_field_get_sql_handler(array $field, $compare_tz = NULL) {
module_load_include('inc', 'date_api', 'date_api_sql');
$db_info = date_api_database_info($field);
@@ -802,11 +821,11 @@ function date_field_get_sql_handler($field, $compare_tz = NULL) {
/**
* Implements hook_field_widget_properties_alter().
- *
- * Alters the widget properties of a field instance before it gets displayed.
- * Used here to flag new entities so we can later tell if they need default values.
*/
-function date_field_widget_properties_alter(&$widget, $context) {
+function date_field_widget_properties_alter(array &$widget, $context) {
+ // Alters the widget properties of a field instance before it gets displayed.
+ // Used here to flag new entities so we can later tell if they need default
+ // values.
if (in_array($widget['type'], array('date_select', 'date_text', 'date_popup'))) {
$entity_type = $context['entity_type'];
$entity = $context['entity'];
@@ -818,3 +837,14 @@ function date_field_widget_properties_alter(&$widget, $context) {
}
}
}
+
+/**
+ * Implements hook_migrate_api().
+ */
+function date_migrate_api() {
+ $api = array(
+ 'api' => 2,
+ 'field handlers' => array('DateMigrateFieldHandler'),
+ );
+ return $api;
+}
diff --git a/frontend/drupal/sites/all/modules/date/date.theme b/frontend/drupal/sites/all/modules/date/date.theme
index c4ea352ac..00776ad61 100644
--- a/frontend/drupal/sites/all/modules/date/date.theme
+++ b/frontend/drupal/sites/all/modules/date/date.theme
@@ -15,46 +15,46 @@
/**
* Returns HTML for a date element formatted as a Start/End combination.
*
- * $entity->date_id
- * If set, this will show only an individual date on a field with
- * multiple dates. The value should be a string that contains
- * the following values, separated with periods:
- * - module name of the module adding the item
- * - node nid
- * - field name
- * - delta value of the field to be displayed
- * - other information the module's custom theme might need
+ * $entity->date_id
+ * If set, this will show only an individual date on a field with
+ * multiple dates. The value should be a string that contains
+ * the following values, separated with periods:
+ * - module name of the module adding the item
+ * - node nid
+ * - field name
+ * - delta value of the field to be displayed
+ * - other information the module's custom theme might need.
*
- * Used by the calendar module and available for other uses.
- * example: 'date.217.field_date.3.test'
+ * Used by the calendar module and available for other uses.
+ * example: 'date.217.field_date.3.test'
*
- * $entity->date_repeat_show
- * If true, tells the theme to show all the computed values of a repeating
- * date. If not true or not set, only the start date and the repeat rule
- * will be displayed.
+ * $entity->date_repeat_show
+ * If TRUE, tells the theme to show all the computed values of a repeating
+ * date. If not TRUE or not set, only the start date and the repeat rule
+ * will be displayed.
*
- * $dates['format']
- * The format string used on these dates
- * $dates['value']['local']['object']
- * The local date object for the Start date
- * $dates['value2']['local']['object']
- * The local date object for the End date
- * $dates['value']['local']['datetime']
- * The datetime value of the Start date database (GMT) value
- * $dates['value2']['local']['datetime']
- * The datetime value of the End date database (GMT) value
- * $dates['value']['formatted']
- * Formatted Start date, i.e. 'February 15, 2007 2:00 pm';
- * $dates['value']['formatted_date']
- * Only the date part of the formatted Start date
- * $dates['value']['formatted_time']
- * Only the time part of the formatted Start date
- * $dates['value2']['formatted']
- * Formatted End date, i.e. 'February 15, 2007 6:00 pm';
- * $dates['value2']['formatted_date']
- * Only the date part of the formatted End date
- * $dates['value2']['formatted_time']
- * Only the time part of the formatted End date
+ * $dates['format']
+ * The format string used on these dates
+ * $dates['value']['local']['object']
+ * The local date object for the Start date
+ * $dates['value2']['local']['object']
+ * The local date object for the End date
+ * $dates['value']['local']['datetime']
+ * The datetime value of the Start date database (GMT) value
+ * $dates['value2']['local']['datetime']
+ * The datetime value of the End date database (GMT) value
+ * $dates['value']['formatted']
+ * Formatted Start date, i.e. 'February 15, 2007 2:00 pm';
+ * $dates['value']['formatted_date']
+ * Only the date part of the formatted Start date
+ * $dates['value']['formatted_time']
+ * Only the time part of the formatted Start date
+ * $dates['value2']['formatted']
+ * Formatted End date, i.e. 'February 15, 2007 6:00 pm';
+ * $dates['value2']['formatted_date']
+ * Only the date part of the formatted End date
+ * $dates['value2']['formatted_time']
+ * Only the time part of the formatted End date
*/
function theme_date_display_combination($variables) {
static $repeating_ids = array();
@@ -77,7 +77,6 @@ function theme_date_display_combination($variables) {
$microdata = $variables['microdata'];
$add_microdata = $variables['add_microdata'];
$precision = date_granularity_precision($field['settings']['granularity']);
- $show_remaining_days = $variables['show_remaining_days'];
$output = '';
@@ -117,6 +116,26 @@ function theme_date_display_combination($variables) {
$element['#entity'] = $entity;
}
+ // Verify these variables exist.
+ if (!isset($dates['value']['formatted'])) {
+ $dates['value']['formatted'] = '';
+ }
+ if (!isset($dates['value2']['formatted'])) {
+ $dates['value2']['formatted'] = '';
+ }
+ if (!isset($dates['value']['formatted_time'])) {
+ $dates['value']['formatted_time'] = '';
+ }
+ if (!isset($dates['value2']['formatted_time'])) {
+ $dates['value2']['formatted_time'] = '';
+ }
+ if (!isset($dates['value1']['formatted_timezone'])) {
+ $dates['value1']['formatted_timezone'] = '';
+ }
+ if (!isset($dates['value2']['formatted_timezone'])) {
+ $dates['value2']['formatted_timezone'] = '';
+ }
+
switch ($options['fromto']) {
case 'value':
$date1 = $dates['value']['formatted'];
@@ -156,9 +175,9 @@ function theme_date_display_combination($variables) {
// Check remaining days.
$show_remaining_days = '';
- if (!empty($variables['show_remaining_days'])) {
- $remaining_days = floor((strtotime($variables['dates']['value']['formatted_iso'])
- - strtotime('now')) / (24 * 3600));
+ if (!empty($variables['show_remaining_days']) && isset($variables['dates']['value']['formatted_iso'])) {
+ $remaining_days = $variables['dates']['value']['formatted_iso'];
+ $remaining_days = floor((strtotime($remaining_days) - strtotime('now')) / (24 * 3600));
// Show remaining days only for future events.
if ($remaining_days >= 0) {
@@ -172,12 +191,13 @@ function theme_date_display_combination($variables) {
if (empty($date1) && empty($date2)) {
$output .= '';
}
+
// Start and End dates match or there is no End date, display a complete
// single date.
elseif ($date1 == $date2 || empty($date2)) {
$output .= theme('date_display_single', array(
'date' => $date1,
- 'timezone' => $timezone,
+ 'timezone' => $has_time_string ? $timezone : '',
'attributes' => $attributes,
'rdf_mapping' => $rdf_mapping,
'add_rdf' => $add_rdf,
@@ -187,6 +207,7 @@ function theme_date_display_combination($variables) {
'show_remaining_days' => $show_remaining_days,
));
}
+
// Same day, different times, don't repeat the date but show both Start and
// End times. We can NOT do this if the replacement value is an integer
// instead of a time string.
@@ -216,12 +237,13 @@ function theme_date_display_combination($variables) {
'dates' => $dates,
));
}
+
// Different days, display both in their entirety.
else {
$output .= theme('date_display_range', array(
'date1' => $date1,
'date2' => $date2,
- 'timezone' => $timezone,
+ 'timezone' => $has_time_string ? $timezone : '',
'attributes' => $attributes,
'rdf_mapping' => $rdf_mapping,
'add_rdf' => $add_rdf,
@@ -251,7 +273,7 @@ function template_preprocess_date_display_single(&$variables) {
$variables['attributes'] = $variables['attributes'] + $base_attributes;
}
- // Pass along microdata attributes, or set display to false if none are set.
+ // Pass along microdata attributes, or set display to FALSE if none are set.
if (!empty($variables['add_microdata'])) {
// Because the Entity API integration for Date has a variable data
// structure depending on whether there is an end value, the attributes
@@ -299,7 +321,7 @@ function template_preprocess_date_display_range(&$variables) {
$variables['attributes_end'] += $variables['attributes'];
if ($variables['add_rdf']) {
- // Pass along the rdf mapping for this field, if any. Add some default rdf
+ // Pass along the rdf mapping for this field, if any. Add some default RDF
// attributes that will be used if not overridden by attributes passed in.
$dates = $variables['dates'];
$base_attributes = array(
@@ -315,7 +337,7 @@ function template_preprocess_date_display_range(&$variables) {
}
}
- // Pass along microdata attributes, or set display to false if none are set.
+ // Pass along microdata attributes, or set display to FALSE if none are set.
if ($variables['add_microdata']) {
if (!empty($variables['microdata']['value']['#attributes'])) {
$variables['microdata']['value']['#attributes']['content'] = $variables['dates']['value']['formatted_iso'];
@@ -336,7 +358,7 @@ function theme_date_display_range($variables) {
$timezone = $variables['timezone'];
$attributes_start = $variables['attributes_start'];
$attributes_end = $variables['attributes_end'];
- $show_remaining_days = $variables['show_remaining_days'];
+ $show_remaining_days = isset($variables['show_remaining_days']) ? $variables['show_remaining_days'] : '';
$start_date = '' . $date1 . '';
$end_date = '' . $date2 . $timezone . '';
@@ -379,7 +401,7 @@ function theme_date_display_interval($variables) {
'interval' => $options['interval'],
'interval_display' => $options['interval_display'],
'use_end_date' => !empty($options['use_end_date']) ?
- $options['use_end_date'] : FALSE,
+ $options['use_end_date'] : FALSE,
);
if ($return = theme('date_time_ago', $time_ago_vars)) {
@@ -462,11 +484,19 @@ function theme_date_form_element($variables) {
// Detect if there is more than one subfield.
$count = count(explode('
' .
- t('Only a limited set of options are displayed here to make this easy to set up. Once the date has been created you will be able to make other changes to the date settings and add other fields to your new content type on the Manage fields screen. You can also make changes to the calendar on the Views edit page.') .
- '
';
+ $output = t("Fill out the following form to auto-create a date content type, with a datetime field and matching pre-configured calendar. If the calendar module is enabled and the option to create a calendar is chosen, a calendar and upcoming events block will be created, an ical feed will be added to the calendar. Nodes created from this new content type will include a link to the calendar, and the calendar will have a link to the 'add new date' form. You can also add new date fields to an existing content type by entering the existing content type name instead of creating a new one.");
+ $output .= '
';
+ $output .= t('Only a limited set of options are displayed here to make this easy to set up. Once the date has been created you will be able to make other changes to the date settings and add other fields to your new content type on the Manage fields screen. You can also make changes to the calendar on the Views edit page.');
+ $output .= '
';
return $output;
}
}
@@ -41,12 +40,11 @@ function date_tools_permission() {
* Implements hook_menu().
*/
function date_tools_menu() {
-
$items = array();
$items['admin/config/date/tools'] = array(
- 'title' => 'Date Tools',
+ 'title' => 'Date Tools',
'description' => 'Date Wizard and other tools to manage and create dates and calendars. ',
- 'access arguments' => array('administer date tools'),
+ 'access arguments' => array('administer date tools'),
'page callback' => 'date_tools_page',
);
$items['admin/config/date/tools/about'] = array(
@@ -68,19 +66,15 @@ function date_tools_menu() {
'file' => 'date_tools.wizard.inc',
);
- // @codingStandardsIgnoreStart
- /**
- $items['admin/config/date/tools/change'] = array(
- 'title' => 'Change type',
- 'access arguments' => array('administer date tools'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('date_tools_change_type_form'),
- 'type' => MENU_LOCAL_TASK,
- 'weight' => 3,
- 'file' => 'date_tools.change_type.inc',
- );
- */
- // @codingStandardsIgnoreEnd
+ // $items['admin/config/date/tools/change'] = array(
+ // 'title' => 'Change type',
+ // 'access arguments' => array('administer date tools'),
+ // 'page callback' => 'drupal_get_form',
+ // 'page arguments' => array('date_tools_change_type_form'),
+ // 'type' => MENU_LOCAL_TASK,
+ // 'weight' => 3,
+ // 'file' => 'date_tools.change_type.inc',
+ // );
return $items;
}
@@ -89,9 +83,5 @@ function date_tools_menu() {
* Main Date Tools page.
*/
function date_tools_page() {
- $content = '';
-
- $content .= t('Dates and calendars can be complicated to set up. The !date_wizard makes it easy to create a simple date content type and related calendar.', array('!date_wizard' => l(t('Date wizard'), 'admin/config/date/tools/date_wizard')));
-
- return $content;
+ return t('Dates and calendars can be complicated to set up. The !date_wizard makes it easy to create a simple date content type and related calendar.', array('!date_wizard' => l(t('Date wizard'), 'admin/config/date/tools/date_wizard')));
}
diff --git a/frontend/drupal/sites/all/modules/date/date_tools/date_tools.wizard.inc b/frontend/drupal/sites/all/modules/date/date_tools/date_tools.wizard.inc
index 94a130a46..7ffee4dd3 100644
--- a/frontend/drupal/sites/all/modules/date/date_tools/date_tools.wizard.inc
+++ b/frontend/drupal/sites/all/modules/date/date_tools/date_tools.wizard.inc
@@ -7,8 +7,6 @@
/**
* Implements hook_form().
- *
- * @todo.
*/
function date_tools_wizard_form() {
$form = array();
@@ -112,6 +110,12 @@ function date_tools_wizard_form() {
'#title' => t('Date timezone handling'),
'#description' => t("Timezone handling should be set to 'none' for granularity without time elements."),
);
+ $form['field']['advanced']['weight'] = array(
+ '#type' => 'textfield',
+ '#default_value' => '-4',
+ '#title' => t('Weight'),
+ '#description' => t("Set the field weight."),
+ );
$form['calendar'] = array(
'#type' => 'select',
'#default_value' => module_exists('calendar'),
@@ -131,9 +135,7 @@ function date_tools_wizard_form() {
}
/**
- * Form validate.
- *
- * @todo.
+ * Form validation.
*/
function date_tools_wizard_form_validate(&$form, &$form_state) {
$bundle = $form_state['values']['bundle'];
@@ -173,8 +175,6 @@ function date_tools_wizard_form_validate(&$form, &$form_state) {
/**
* Form submit.
- *
- * @todo.
*/
function date_tools_wizard_form_submit(&$form, &$form_state) {
$view_name = date_tools_wizard_build($form_state['values']);
@@ -189,8 +189,6 @@ function date_tools_wizard_form_submit(&$form, &$form_state) {
/**
* Wizard build.
- *
- * @todo.
*/
function date_tools_wizard_build($form_values) {
extract($form_values);
@@ -198,9 +196,8 @@ function date_tools_wizard_build($form_values) {
$field_name = 'field_' . $field_name;
$base_table = 'node';
- // Create a node type if it doesn't already exist.
- // This makes it possible to add additional date fields to
- // an existing type.
+ // Create a node type if it doesn't already exist. This makes it possible to
+ // add additional date fields to an existing type.
$types = node_type_get_names();
$type_settings = array();
if (!array_key_exists($bundle, $types)) {
@@ -238,7 +235,7 @@ function date_tools_wizard_build($form_values) {
'label' => $label,
'bundle' => $bundle,
// Move the date right below the title.
- 'weight' => -4,
+ 'weight' => $weight,
'widget' => array(
'type' => $widget_type,
// Increment for minutes and seconds, can be 1, 5, 10, 15, or 30.
@@ -252,7 +249,7 @@ function date_tools_wizard_build($form_values) {
'label_position' => 'above',
'repeat_collapsed' => 0,
),
- 'weight' => -4,
+ 'weight' => $weight,
),
'settings' => array(
'default_value' => 'now',
@@ -295,8 +292,8 @@ function date_tools_wizard_build($form_values) {
$instance = field_create_instance($instance);
$view_name = 'calendar_node_' . $field_name;
- field_info_cache_clear(TRUE);
- field_cache_clear(TRUE);
+ field_info_cache_clear();
+ field_cache_clear();
drupal_set_message(t('Your date field @name has been created.', array('@name' => $label)));
@@ -305,8 +302,6 @@ function date_tools_wizard_build($form_values) {
/**
* Includes handler.
- *
- * @todo.
*/
function date_tools_wizard_include() {
module_load_include('inc', 'node', 'content_types');
@@ -317,8 +312,6 @@ function date_tools_wizard_include() {
/**
* Implements hook_field_types().
- *
- * @todo.
*/
function date_tools_wizard_field_types() {
$field_types = array();
@@ -330,7 +323,6 @@ function date_tools_wizard_field_types() {
/**
* Implements hook_widget_types().
- * @todo.
*/
function date_tools_wizard_widget_types() {
$widget_types = array();
@@ -344,8 +336,6 @@ function date_tools_wizard_widget_types() {
/**
* Tz handler.
- *
- * @todo.
*/
function date_tools_wizard_tz_handling() {
include_once drupal_get_path('module', 'date') . '/date_admin.inc';
@@ -354,11 +344,8 @@ function date_tools_wizard_tz_handling() {
/**
* Create date tools wizard content type.
- *
- * @todo.
*/
function date_tools_wizard_create_content_type($name, $bundle, $description, $type_settings = array()) {
-
date_tools_wizard_include();
// Create the content type.
@@ -427,5 +414,4 @@ function date_tools_wizard_create_content_type($name, $bundle, $description, $ty
),
);
field_create_instance($instance);
-
}
diff --git a/frontend/drupal/sites/all/modules/date/date_tools/tests/DateToolsTestCase.test b/frontend/drupal/sites/all/modules/date/date_tools/tests/DateToolsTestCase.test
new file mode 100644
index 000000000..f481d83e8
--- /dev/null
+++ b/frontend/drupal/sites/all/modules/date/date_tools/tests/DateToolsTestCase.test
@@ -0,0 +1,124 @@
+ 'Date Tools',
+ 'description' => 'Test Date Wizard and other Date Tools.',
+ 'group' => 'Date',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp(array $modules = array()) {
+ $modules[] = 'field';
+ $modules[] = 'field_ui';
+ $modules[] = 'date_api';
+ $modules[] = 'date';
+ $modules[] = 'date_popup';
+ $modules[] = 'date_tools';
+ parent::setUp($modules);
+
+ // Create and log in our privileged user.
+ $perms = array(
+ 'administer content types',
+ 'administer nodes',
+ 'bypass node access',
+ 'administer date tools',
+ 'administer fields',
+ );
+ $this->privileged_user = $this->drupalCreateUser($perms);
+ $this->drupalLogin($this->privileged_user);
+
+ variable_set('date_format_long', 'D, m/d/Y - H:i');
+ }
+
+ /**
+ * Creates a date field using the Date Wizard.
+ */
+ public function testTools() {
+ $form_values = array(
+ 'label' => 'Test',
+ 'field_type' => 'datetime',
+ 'widget_type' => 'date_select',
+ 'todate' => '',
+ );
+ $this->createDateWizard($form_values);
+ $this->dateForm($options = 'select');
+ $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for the Date Wizard datetime field using the date_select widget.');
+ $this->deleteDateField();
+ }
+
+ /**
+ * Tests that date field functions properly.
+ */
+ function dateForm($options) {
+ $edit = array();
+ $edit['title'] = $this->randomName(8);
+ $edit['body[und][0][value]'] = $this->randomName(16);
+ if ($options == 'select') {
+ $edit['field_test[und][0][value][year]'] = '2010';
+ $edit['field_test[und][0][value][month]'] = '10';
+ $edit['field_test[und][0][value][day]'] = '7';
+ $edit['field_test[und][0][value][hour]'] = '10';
+ $edit['field_test[und][0][value][minute]'] = '30';
+ }
+ elseif ($options == 'text') {
+ $edit['field_test[und][0][value][date]'] = '10/07/2010 - 10:30';
+ }
+ elseif ($options == 'popup') {
+ $edit['field_test[und][0][value][date]'] = '10/07/2010';
+ $edit['field_test[und][0][value][time]'] = '10:30';
+ }
+ $this->drupalPost('node/add/story', $edit, t('Save'));
+ $this->assertText($edit['body[und][0][value]'], 'Test node has been created');
+ }
+
+ /**
+ * @todo
+ */
+ function deleteDateField() {
+ $this->drupalGet('admin/structure/types/manage/story/fields');
+ $this->clickLink('delete');
+ $this->drupalPost(NULL, NULL, t('Delete'));
+ $this->assertText('The field Test has been deleted from the Story content type.', 'Removed date field.');
+ }
+
+ /**
+ * Creates a date field using the Date Wizard.
+ */
+ function createDateWizard($edit) {
+ $edit += array(
+ 'bundle' => 'story',
+ 'name' => 'Story',
+ 'type_description' => 'A test content type.',
+ 'field_name' => 'test',
+ 'label' => 'Test',
+ 'widget_type' => 'date_select',
+ 'todate' => 'optional',
+ 'field_type' => 'date',
+ 'granularity[]' => array('year', 'month', 'day', 'hour', 'minute'),
+ 'tz_handling' => 'site',
+ 'year_range' => '2010:+2',
+ 'weight' => -100,
+ );
+ $this->drupalPost('admin/config/date/tools/date_wizard', $edit, t('Save'));
+ $this->assertText('Your date field Test has been created.', 'Create a date field using the Date Wizard.');
+ }
+
+}
diff --git a/frontend/drupal/sites/all/modules/date/date_views/css/date_views.css b/frontend/drupal/sites/all/modules/date/date_views/css/date_views.css
index a0121ea9b..c89d18722 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/css/date_views.css
+++ b/frontend/drupal/sites/all/modules/date/date_views/css/date_views.css
@@ -1,4 +1,9 @@
-/* Pager plugin css */
+/**
+ * @file
+ * Custom CSS for the Date Views module.
+ */
+
+/* Pager plugin. */
div.date-views-pager {
margin-left: auto;
margin-right: auto;
@@ -19,7 +24,7 @@ div.date-views-pager div.next-year {
}
-/* Views filter form css */
+/* Views filter form. */
.views-group-box div.date-views-filter-fieldset {
margin-left: 0;
}
@@ -47,9 +52,10 @@ div.date-views-pager div.next-year {
}
/**
- * Style Header
+ * Style Header.
+ * Give the navigation bar a little extra padding below so it will clear the
+ * new contextual links overlay of the teasers below it.
*/
-/* Give the navigation bar a little extra padding below so it will clear the new contextual links overlay of the teasers below it. */
.date-nav {
clear: both;
padding-bottom: 1.5em;
@@ -64,7 +70,7 @@ div.date-views-pager div.next-year {
margin-bottom: 10px;
}
-.date-nav-wrapper {
+.date-nav-wrapper {
position: relative;
margin-top: 5px;
width: 100%;
@@ -139,4 +145,4 @@ div.date-views-pager div.next-year {
.date-nav-wrapper .date-next a {
margin-right: 10px;
font-weight: bold;
-}
\ No newline at end of file
+}
diff --git a/frontend/drupal/sites/all/modules/date/date_views/date_views.info b/frontend/drupal/sites/all/modules/date/date_views/date_views.info
index 68b32cc2e..bc19f3a29 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/date_views.info
+++ b/frontend/drupal/sites/all/modules/date/date_views/date_views.info
@@ -1,10 +1,12 @@
name = Date Views
description = Views integration for date fields and date functionality.
package = Date/Time
-dependencies[] = date_api
-dependencies[] = views
core = 7.x
php = 5.2
+
+dependencies[] = date:date_api
+dependencies[] = views:views
+
files[] = includes/date_views_argument_handler.inc
files[] = includes/date_views_argument_handler_simple.inc
files[] = includes/date_views_filter_handler.inc
@@ -12,9 +14,12 @@ files[] = includes/date_views_filter_handler_simple.inc
files[] = includes/date_views.views.inc
files[] = includes/date_views_plugin_pager.inc
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Test coverage.
+files[] = tests/date_views_filter.test
+files[] = tests/date_views_pager.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
core = "7.x"
project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/frontend/drupal/sites/all/modules/date/date_views/date_views.module b/frontend/drupal/sites/all/modules/date/date_views/date_views.module
index c050e56e7..59277a931 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/date_views.module
+++ b/frontend/drupal/sites/all/modules/date/date_views/date_views.module
@@ -26,7 +26,6 @@ function date_views_menu() {
* Form callback for date views settings.
*/
function date_views_settings($form, &$form_state) {
-
$form['date_views_month_format_with_year'] = array(
'#type' => 'textfield',
'#title' => t('Date views month format with year'),
@@ -76,15 +75,13 @@ function date_views_settings($form, &$form_state) {
);
return system_settings_form($form);
-
}
/**
* Implements hook_views_api().
- *
- * This one is used as the base to reduce errors when updating.
*/
function date_views_theme() {
+ // This one is used as the base to reduce errors when updating.
$path = drupal_get_path('module', 'date_views');
$base = array(
'file' => 'theme.inc',
@@ -165,23 +162,29 @@ function date_views_fields($base = 'node', $reset = FALSE) {
/**
* Implements hook_date_views_entities().
- *
- * Map extra Views tables to the entity that holds its date fields, needed for Views tables other than the primary tables identified in entity_info().
*/
function date_views_date_views_extra_tables() {
+ // Map extra Views tables to the entity that holds its date fields, needed
+ // for Views tables other than the primary tables identified in entity_info().
return array(
'node_revision' => 'node',
);
}
/**
- * Helper function to map entity types to the Views base table they use, to make it easier to infer the entity type from a base table.
+ * Helper function to map entity types to the Views base table they use.
*
- * Views has a new handler called views_handler_field_entity() that loads entities.
+ * Used to make it easier to infer the entity type from a base table.
*
- * And you can use something like the following to get the entity type from a view, but not all our base tables contain the entity information we need, (i.e. revisions).
+ * Views has a new handler called views_handler_field_entity() that loads
+ * entities.
*
- * So it won't work here and we resort to creating information from entity_get_info().
+ * And you can use something like the following to get the entity type from a
+ * view, but not all our base tables contain the entity information we need,
+ * (i.e. revisions).
+ *
+ * So it won't work here and we resort to creating information from
+ * entity_get_info().
*
* // A method to get the entity type for a base table.
* $table_data = views_fetch_data($base_table);
@@ -194,7 +197,6 @@ function date_views_base_tables() {
$base_tables = &drupal_static(__FILE__, array());
if (empty($base_tables)) {
-
// First we get the base tables we can learn about from entity_info.
$entity_info = entity_get_info();
foreach ($entity_info as $entity_type => $info) {
@@ -206,7 +208,8 @@ function date_views_base_tables() {
}
}
- // Then we let other modules tell us about other entity tables that hold date fields.
+ // Then we let other modules tell us about other entity tables that hold
+ // date fields.
$base_tables += module_invoke_all('date_views_extra_tables');
}
@@ -215,10 +218,12 @@ function date_views_base_tables() {
/**
* Implements hook_date_views_fields().
- *
- * All modules that create custom fields that use the 'views_handler_field_date' handler can provide additional information here about the type of date they create so the date can be used by the Date API views date argument and date filter.
*/
function date_views_date_views_fields($field) {
+ // All modules that create custom fields that use the
+ // 'views_handler_field_date' handler can provide additional information here
+ // about the type of date they create so the date can be used by the Date API
+ // views date argument and date filter.
$values = array(
// The type of date: DATE_UNIX, DATE_ISO, DATE_DATETIME.
'sql_type' => DATE_UNIX,
@@ -249,11 +254,11 @@ function date_views_date_views_fields($field) {
}
/**
- * A version of date_real_url that formats links correctly for the new Date pager.
+ * A version of date_real_url that formats links correctly for the Date pager.
*/
function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_url = FALSE, $absolute = TRUE) {
-
- // If someone adds a pager without a matching argument, there is not date information to work with.
+ // If someone adds a pager without a matching argument, there is not date
+ // information to work with.
if (empty($view->date_info) || !isset($view->date_info->date_arg_pos)) {
return '';
}
@@ -261,13 +266,12 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
$args = $view->args;
$pos = $view->date_info->date_arg_pos;
- // The View arguments array is indexed numerically but is not necessarily
- // in numerical order. Sort the arguments to ensure the correct order.
+ // The View arguments array is indexed numerically but is not necessarily in
+ // numerical order. Sort the arguments to ensure the correct order.
ksort($args);
- // If there are empty arguments before the date argument,
- // pad them with the wildcard so the date argument will be in
- // the right position.
+ // If there are empty arguments before the date argument, pad them with the
+ // wildcard so the date argument will be in the right position.
if (count($args) < $pos) {
foreach ($view->argument as $name => $argument) {
if ($argument->position == $pos) {
@@ -293,7 +297,6 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
default:
$args[$pos] = date_pad($view->date_info->year, 4) . '-' . date_pad($view->date_info->month);
- break;
}
}
elseif (!empty($date_arg)) {
@@ -302,11 +305,10 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
else {
$args = $view->args;
}
- // Is this an embedded or a block view?
- // Return the pager query value.
- if (!$force_view_url &&
- (!empty($view->preview) || !empty($view->date_info->block_identifier))) {
+ // Is this an embedded or a block view? Return the pager query value.
+ if (!$force_view_url &&
+ (!empty($view->preview) || !empty($view->date_info->block_identifier))) {
$url = $args[$pos];
$key = date_block_identifier($view);
if (!empty($key)) {
@@ -316,8 +318,8 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
}
}
- // Normal views may need querystrings appended to them
- // if they use exposed filters.
+ // Normal views may need querystrings appended to them if they use exposed
+ // filters.
return url($view->get_url($args), array(
'query' => date_views_querystring($view),
'absolute' => $absolute,
@@ -337,12 +339,12 @@ function date_block_identifier($view) {
/**
* Implements hook_field_views_data_alter().
- *
- * Create a Views field for each date column we care about to supplement the generic 'entity_id' and 'revision_id' fields that are automatically created.
- *
- * Also use friendlier labels to distinguish the start date and end date in listings (for fields that use both).
*/
function date_views_field_views_data_alter(&$result, $field, $module) {
+ // Create a Views field for each date column we care about to supplement the
+ // generic 'entity_id' and 'revision_id' fields that are automatically
+ // created. Also use friendlier labels to distinguish the start date and end
+ // date in listings (for fields that use both).
if ($module == 'date') {
$has_end_date = !empty($field['settings']['todate']);
if ($has_end_date) {
@@ -358,8 +360,9 @@ function date_views_field_views_data_alter(&$result, $field, $module) {
// The old values are still there with a 'moved to' key, so ignore them.
if (array_key_exists('field', $value) && !array_key_exists('moved to', $value['field'])) {
$result[$table][$column]['field']['is date'] = TRUE;
- // Not sure yet if we still need a custom field handler in D7 now that custom formatters are available.
- // Might still need it to handle grouping of multiple value dates.
+ // Not sure yet if we still need a custom field handler in D7 now
+ // that custom formatters are available. Might still need it to
+ // handle grouping of multiple value dates.
// $result[$table][$column]['field']['handler'] = 'date_handler_field_date';
// $result[$table][$column]['field']['add fields to query'] = TRUE;
}
@@ -458,9 +461,35 @@ function date_views_form_views_ui_edit_form_alter(&$form, &$form_state, $form_id
}
/**
- * The instanceof function makes this work for any handler that was derived from 'views_handler_filter_date' or 'views_handler_argument_date', which includes core date fields like the node updated field.
+ * Implements hook_form_FORM_ID_alter() for views_exposed_form().
+ */
+function date_views_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
+ $children = element_children($form);
+ // @todo On a stock views_exposed_form, there won't be any grandchildren
+ // items, but will this always be the case? How about better_exposed_filters?
+ foreach ($children as $child) {
+ if (isset($form[$child]['#id']) && strpos($form[$child]['#id'], 'date_views_exposed_filter-') === 0) {
+ // Remove empty or scalar date input when an array was expected.
+ if (empty($form_state['input'][$child]) || !is_array($form_state['input'][$child])) {
+ unset($form_state['input'][$child]);
+ }
+ elseif (empty($form_state['input'][$child]['value']) || !is_array($form_state['input'][$child]['value'])) {
+ unset($form_state['input'][$child]['value']);
+ }
+ }
+ }
+}
+
+/**
+ * Work out if the plugin is a date.
*
- * The test for $handler->min_date tells us that this is an argument that not only is derived from the views date handler but also has been processed by the Date Views filter or argument code.
+ * The instanceof function makes this work for any handler that was derived from
+ * 'views_handler_filter_date' or 'views_handler_argument_date', which includes
+ * core date fields like the node updated field.
+ *
+ * The test for $handler->min_date tells us that this is an argument that not
+ * only is derived from the views date handler but also has been processed by
+ * the Date Views filter or argument code.
*/
function date_views_handler_is_date($handler, $type = 'argument') {
switch ($type) {
@@ -476,7 +505,8 @@ function date_views_handler_is_date($handler, $type = 'argument') {
/**
* Validation hook for exposed filters that use the select widget.
*
- * This is to ensure the the user completes all parts of the date not just some parts. Only needed for the select widget.
+ * This is to ensure the the user completes all parts of the date not just some
+ * parts. Only needed for the select widget.
*/
function date_views_select_validate(&$form, &$form_state) {
// If there are no values just return.
@@ -525,10 +555,10 @@ function date_views_select_validate(&$form, &$form_state) {
/**
* Implements hook_date_formatter_view_alter().
- *
- * If we are displaying a date from a view, see if we have information about which multiple value to display. If so, set the date_id in the entity.
*/
function date_views_date_formatter_pre_view_alter(&$entity, &$variables) {
+ // If we are displaying a date from a view, see if we have information about
+ // which multiple value to display. If so, set the date_id in the entity.
// Some views have no row index.
if (!empty($entity->view) && isset($entity->view->row_index)) {
$field = $variables['field'];
diff --git a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views.views.inc b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views.views.inc
index f226def63..1f710e537 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views.views.inc
+++ b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views.views.inc
@@ -1,7 +1,8 @@
db_timezone = 'UTC';
$date_handler->local_timezone = date_default_timezone();
- break;
}
}
@@ -183,7 +182,6 @@ function date_views_set_timezone(&$date_handler, &$view, $field) {
*
* @param object $view
* A View object.
- *
* @param array $extra_params
* An extra parameters.
*
@@ -192,24 +190,29 @@ function date_views_set_timezone(&$date_handler, &$view, $field) {
*/
function date_views_querystring($view, $extra_params = array()) {
$query_params = array_merge($_GET, $extra_params);
+
// Allow NULL params to be removed from the query string.
foreach ($extra_params as $key => $value) {
if (!isset($value)) {
unset($query_params[$key]);
}
}
+
// Filter the special "q" and "view" variables out of the query string.
$exclude = array('q');
+
// If we don't explicitly add a value for "view", filter it out.
if (empty($extra_params['view'])) {
$exclude[] = 'view';
}
+
// Clear out old date pager settings if not explicitly added.
if (!empty($view->date_info->pager_id) && empty($extra_params[$view->date_info->pager_id])) {
$exclude[] = $view->date_info->pager_id;
}
$query = drupal_get_query_parameters($query_params, $exclude);
+
// To prevent an empty query string from adding a "?" on to the end of a URL,
// we return NULL.
return !empty($query) ? $query : NULL;
diff --git a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc
index 20eedff0e..cdea1deb5 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc
+++ b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc
@@ -1,21 +1,21 @@
base_table);
if (!empty($this->options['date_fields'])) {
@@ -115,15 +123,13 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
}
/**
- * Provide a list of default behaviors for this argument if the argument
- * is not present.
- *
- * Override this method to provide additional (or fewer) default behaviors.
+ * {@inheritdoc}
*/
function default_actions($which = NULL) {
$defaults = parent::default_actions();
- // There is no easy way to do summary queries on multiple fields, so remove that option.
+ // There is no easy way to do summary queries on multiple fields, so remove
+ // that option.
unset($defaults['summary']);
if ($which) {
@@ -137,14 +143,11 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
}
/**
- * Set up the query for this argument.
- *
- * The argument sent may be found at $this->argument.
+ * {@inheritdoc}
*/
function query($group_by = FALSE) {
-
- // @TODO Not doing anything with $group_by yet, need to figure out what has to be done.
-
+ // @todo Not doing anything with $group_by yet, need to figure out what has
+ // to be done.
if ($this->date_forbid()) {
return;
}
@@ -156,8 +159,8 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
$this->placeholders = array();
if (!empty($this->query_fields)) {
- // Use set_where_group() with the selected date_method
- // of 'AND' or 'OR' to create the where clause.
+ // Use set_where_group() with the selected date_method of 'AND' or 'OR'
+ // to create the where clause.
foreach ($this->query_fields as $count => $query_field) {
$field = $query_field['field'];
$this->date_handler = $query_field['date_handler'];
@@ -168,8 +171,9 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
if ($field['table_name'] != $this->table || !empty($this->relationship)) {
$this->table = $this->query->ensure_table($field['table_name'], $this->relationship);
}
- // $this->table_alias gets set when the first field is processed if otherwise empty.
- // For subsequent fields, we need to be sure it is emptied again.
+ // $this->table_alias gets set when the first field is processed if
+ // otherwise empty. For subsequent fields, we need to be sure it is
+ // emptied again.
elseif (empty($this->relationship)) {
$this->table_alias = NULL;
}
@@ -181,7 +185,7 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
}
/**
- * Collect information about our fields we will need to create the right query.
+ * {@inheritdoc}
*/
function get_query_fields() {
$fields = date_views_fields($this->base_table);
@@ -200,4 +204,3 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
}
}
-// @codingStandardsIgnoreEnd
diff --git a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
index 2839b9593..0de4454ce 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
+++ b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
@@ -1,19 +1,17 @@
date_handler->local_timezone = date_get_timezone($field['settings']['tz_handling']);
}
$this->date_handler->granularity = $this->options['granularity'];
- // This value needs to be initialized so
- // it exists even if the query doesn't run.
+ // This value needs to be initialized so it exists even if the query
+ // doesn't run.
$this->date_handler->placeholders = array();
$this->format = $this->date_handler->views_formats($this->date_handler->granularity, 'display');
$this->sql_format = $this->date_handler->views_formats($this->date_handler->granularity, 'sql');
- // $this->arg_format is the format the parent date
- // handler will use to create a default argument.
+ // $this->arg_format is the format the parent date handler will use to
+ // create a default argument.
$this->arg_format = $this->format();
- // Identify the base table for this field.
- // It will be used to call for the right query field options.
+ // Identify the base table for this field. It will be used to call for the
+ // right query field options.
$this->base_table = $this->table;
-
}
/**
@@ -60,9 +57,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Set the empty argument value to the current date.
- *
- * Formatted appropriately for this argument.
+ * {@inheritdoc}
*/
function get_default_argument($raw = FALSE) {
$is_default = FALSE;
@@ -87,9 +82,10 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Default value for the date_fields option.
+ * {@inheritdoc}
*/
function option_definition() {
+ // Default value for the date_fields option.
$options = parent::option_definition();
$options['year_range'] = array('default' => '-3:+3');
$options['granularity'] = array('default' => 'month');
@@ -103,7 +99,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Add a form element to select date_fields for this argument.
+ * {@inheritdoc}
*/
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
@@ -149,6 +145,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
// Get default granularity options
$options = $this->date_handler->date_parts();
+
// Add the 'week' option.
$options += array(
'week' => t('Week', array(), array(
@@ -214,7 +211,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Provide a link to the next level of the view from the summary.
+ * {@inheritdoc}
*/
function summary_name($data) {
$value = $data->{$this->name_alias};
@@ -230,7 +227,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Provide a title for the view based on the argument value.
+ * {@inheritdoc}
*/
function title() {
$format = !empty($this->options['title_format_custom']) && !empty($this->options['title_format_custom']) ? $this->options['title_format_custom'] : $this->date_handler->views_formats($this->options['granularity'], 'display');
@@ -239,13 +236,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Provide the argument to use to link from the summary to the next level.
- *
- * This will be called once per row of a summary, and used as part of
- * $view->get_url().
- *
- * @param object $data
- * The query results for the row.
+ * {@inheritdoc}
*/
function summary_argument($data) {
$format = $this->date_handler->views_formats($this->options['granularity'], 'sql');
@@ -258,24 +249,25 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Inject a test for valid date range before the summary query.
+ * {@inheritdoc}
*/
function summary_query() {
-
- // @TODO The summary values are computed by the database.
- // Unless the database has built-in timezone handling it will use
- // a fixed offset, which will not be right for all dates.
- // The only way I can see to make this work right is to store the offset
- // for each date in the database so it can be added to the base
- // date value before the database formats the result. Because this is a huge
- // architectural change, it won't go in until we start a new branch.
+ // Inject a test for valid date range before the summary query.
+ // @todo The summary values are computed by the database. Unless the
+ // database has built-in timezone handling it will use a fixed offset,
+ // which will not be right for all dates. The only way I can see to make
+ // this work right is to store the offset for each date in the database so
+ // it can be added to the base date value before the database formats the
+ // result. Because this is a huge architectural change, it won't go in
+ // until we start a new branch.
$this->formula = $this->date_handler->sql_format($this->sql_format, $this->date_handler->sql_field("***table***.$this->real_field"));
$this->ensure_my_table();
+
// Now that our table is secure, get our formula.
$formula = $this->get_formula();
- // Add the field, give it an alias that does NOT match the actual
- // field name or grouping won't work right.
+ // Add the field, give it an alias that does NOT match the actual field
+ // name or grouping won't work right.
$this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field . '_summary');
$this->query->set_count_field(NULL, $formula, $this->field);
@@ -283,22 +275,20 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
/**
- * Inject a test for valid date range before the regular query.
- *
- * Override the parent query to be able to control the $group.
+ * {@inheritdoc}
*/
function query($group_by = FALSE) {
-
- // @TODO Not doing anything with $group_by yet,
- // need to figure out what has to be done.
-
+ // Inject a test for valid date range before the regular query. Override
+ // the parent query to be able to control the $group.
+ // @todo Not doing anything with $group_by yet, need to figure out what has
+ // to be done.
if ($this->date_forbid()) {
return;
}
- // See if we need to reset granularity based on an argument value.
- // Make sure we don't try to reset to some bogus value if someone has
- // typed in an unexpected argument.
+ // See if we need to reset granularity based on an argument value. Make
+ // sure we don't try to reset to some bogus value if someone has typed in
+ // an unexpected argument.
if ($this->options['granularity_reset'] && $granularity = $this->date_handler->arg_granularity($this->argument)) {
$this->date_handler->granularity = $granularity;
$this->format = $this->date_handler->views_formats($this->date_handler->granularity, 'display');
@@ -308,8 +298,8 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
$this->ensure_my_table();
$group = !empty($this->options['date_group']) ? $this->options['date_group'] : 0;
- // If requested, add the delta field to the view so
- // we can later find the value that matched our query.
+ // If requested, add the delta field to the view so we can later find the
+ // value that matched our query.
if (!empty($this->options['add_delta']) && (substr($this->real_field, -6) == '_value' || substr($this->real_field, -7) == '_value2')) {
$this->query->add_field($this->table_alias, 'delta');
$real_field_name = str_replace(array('_value', '_value2'), '', $this->real_field);
@@ -324,10 +314,9 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
$view_max_placeholder = $this->placeholder();
$this->date_handler->placeholders = array($view_min_placeholder => $view_min, $view_max_placeholder => $view_max);
- // Are we comparing this field only or the Start/End date range
- // to the view criteria?
+ // Are we comparing this field only or the Start/End date range to the view
+ // criteria?
if (!empty($this->options['use_fromto'])) {
-
// The simple case, match the field to the view range.
$field = $this->date_handler->sql_field($this->table_alias . '.' . $this->real_field, NULL, $this->min_date);
$field = $this->date_handler->sql_format($format, $field);
@@ -335,15 +324,12 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
else {
-
- // Look for the intersection of the range
- // of the date field with the range of the view.
- // Get the Start/End values for this field.
- // Retrieve using the original table name.
- // Swap the current table name (adjusted for relationships)
- // into the query.
- // @TODO We may be able to use Views substitutions here,
- // investigate that later.
+ // Look for the intersection of the range of the date field with the
+ // range of the view. Get the Start/End values for this field. Retrieve
+ // using the original table name. Swap the current table name (adjusted
+ // for relationships) into the query.
+ // @todo We may be able to use Views substitutions here, investigate that
+ // later.
$fields = date_views_fields($this->base_table);
$fields = $fields['name'];
$fromto = $fields[$this->original_table . '.' . $this->real_field]['fromto'];
@@ -361,8 +347,8 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
/**
* Add a callback.
*
- * To determine if we have moved outside
- * the valid date range for this argument.
+ * To determine if we have moved outside the valid date range for this
+ * argument.
*/
function date_forbid() {
if (empty($this->argument)) {
@@ -384,4 +370,3 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
}
}
-// @codingStandardsIgnoreEnd
diff --git a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_fields.inc b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_fields.inc
index d497ef602..b8aad1543 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_fields.inc
+++ b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_fields.inc
@@ -1,4 +1,5 @@
view->date_info->date_fields = array_merge($this->view->date_info->date_fields, $this->options['date_fields']);
}
- // Set default values for the date filter.
+ /**
+ * {@inheritdoc}
+ */
function option_definition() {
$options = parent::option_definition();
$options['date_fields'] = array('default' => array());
@@ -30,18 +40,30 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
return $options;
}
+ /**
+ * @todo
+ */
function op_between($field) {
$this->date_combine_conditions('op_between');
}
+ /**
+ * @todo
+ */
function op_simple($field) {
$this->date_combine_conditions('op_simple');
}
+ /**
+ * @todo
+ */
function op_contains($field) {
$this->date_combine_conditions('op_contains');
}
+ /**
+ * @todo
+ */
function op_empty($field) {
$this->get_query_fields();
if (empty($this->query_fields)) {
@@ -83,6 +105,7 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
// Create a custom filter group for the conditions.
$this->query->set_where_group($this->options['date_method'], $this->options['date_group']);
+
// Add each condition to the custom filter group.
foreach ((array) $this->query_fields as $query_field) {
$field = $query_field['field'];
@@ -120,6 +143,9 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
$this->query->add_where_expression($this->options['group'], $conditions, $placeholders);
}
+ /**
+ * {@inheritdoc}
+ */
function extra_options_form(&$form, &$form_state) {
parent::extra_options_form($form, $form_state);
@@ -147,6 +173,9 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
);
}
+ /**
+ * {@inheritdoc}
+ */
function extra_options_validate($form, &$form_state) {
$check_fields = array_filter($form_state['values']['options']['date_fields']);
if (empty($check_fields)) {
@@ -154,12 +183,16 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
}
}
+ /**
+ * {@inheritdoc}
+ */
function extra_options_submit($form, &$form_state) {
$form_state['values']['options']['date_fields'] = array_filter($form_state['values']['options']['date_fields']);
}
- // Update the summary values to provide
- // meaningful information for each option.
+ /**
+ * {@inheritdoc}
+ */
function admin_summary() {
if (empty($this->options['date_fields'])) {
return t('Missing date fields!');
@@ -195,6 +228,9 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
return $output;
}
+ /**
+ * @todo
+ */
function get_query_fields() {
$fields = date_views_fields($this->base_table);
$fields = $fields['name'];
@@ -209,5 +245,5 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
}
}
}
+
}
-// @codingStandardsIgnoreEnd
diff --git a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
index 4fa4c4090..d19dc2d4d 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
+++ b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
@@ -1,15 +1,28 @@
date_handler->granularity = isset($options['granularity']) ? $options['granularity'] : 'day';
$this->format = $this->date_handler->views_formats($this->options['granularity'], 'sql');
- // Identify the base table for this field.
- // It will be used to call for the right query field options.
+ // Identify the base table for this field. It will be used to call for the
+ // right query field options.
$this->base_table = $this->table;
-
}
- // Set default values for the date filter.
+ /**
+ * {@inheritdoc}
+ */
function option_definition() {
$options = parent::option_definition();
$options['granularity'] = array('default' => 'day');
@@ -44,14 +58,24 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
return $options;
}
+ /**
+ * {@inheritdoc}
+ */
function operators() {
+ // Cache the operators that are being added.
+ static $new_operators;
+ if (!isset($new_operators)) {
+ $new_operators = array(
+ 'title' => t('Contains'),
+ 'method' => 'op_contains',
+ 'short' => t('contains'),
+ 'values' => 1,
+ );
+ }
+
+ // Add the new 'contains' operators.
$operators = parent::operators();
- $operators['contains'] = array(
- 'title' => t('Contains'),
- 'method' => 'op_contains',
- 'short' => t('contains'),
- 'values' => 1,
- );
+ $operators['contains'] = $new_operators;
return $operators;
}
@@ -91,9 +115,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
/**
* Helper function to see if we need to swap in the default value.
*
- * Views exposed filters treat everything as submitted, so if it's an empty value we have to
- * see if anything actually was submitted. If nothing has really been submitted, we need
- * to swap in our default value logic.
+ * Views exposed filters treat everything as submitted, so if it's an empty
+ * value we have to see if anything actually was submitted. If nothing has
+ * really been submitted, we need to swap in our default value logic.
*/
function get_filter_value($prefix, $input) {
// All our date widgets provide datetime values but we use ISO in our SQL
@@ -111,6 +135,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
return str_replace(' ', 'T', $input);
}
+ /**
+ * {@inheritdoc}
+ */
function accept_exposed_input($input) {
if (!empty($this->options['exposed'])) {
$element_input = $input[$this->options['expose']['identifier']];
@@ -127,12 +154,14 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$input[$this->options['expose']['identifier']] = $element_input;
}
return parent::accept_exposed_input($input);
-
}
+ /**
+ * @todo
+ */
function op_between($field) {
-
- // Add the delta field to the view so we can later find the value that matched our query.
+ // Add the delta field to the view so we can later find the value that
+ // matched our query.
list($table_name, $field_name) = explode('.', $field);
if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {
$this->query->add_field($table_name, 'delta');
@@ -160,9 +189,12 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
}
}
+ /**
+ * @todo
+ */
function op_simple($field) {
-
- // Add the delta field to the view so we can later find the value that matched our query.
+ // Add the delta field to the view so we can later find the value that
+ // matched our query.
list($table_name, $field_name) = explode('.', $field);
if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {
$this->query->add_field($table_name, 'delta');
@@ -180,9 +212,12 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$this->query->add_where_expression($group, "$field $this->operator $placeholder", array($placeholder => $value));
}
+ /**
+ * @todo
+ */
function op_contains($field) {
-
- // Add the delta field to the view so we can later find the value that matched our query.
+ // Add the delta field to the view so we can later find the value that
+ // matched our query.
list($table_name, $field_name) = explode('.', $field);
if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {
$this->query->add_field($table_name, 'delta');
@@ -204,12 +239,14 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
}
/**
- * Set the granularity of the date parts to use in the filter.
- */
- function has_extra_options() { return TRUE; }
+ * {@inheritdoc}
+ */
+ function has_extra_options() {
+ return TRUE;
+ }
/**
- * Date selection options.
+ * {@inheritdoc}
*/
function widget_options() {
$options = array(
@@ -223,6 +260,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
return $options;
}
+ /**
+ * @todo
+ */
function year_range() {
$year_range = explode(':', $this->options['year_range']);
if (substr($this->options['year_range'], 0, 1) == '-' || $year_range[0] < 0) {
@@ -233,6 +273,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
return $year_range;
}
+ /**
+ * {@inheritdoc}
+ */
function extra_options_form(&$form, &$form_state) {
parent::extra_options_form($form, $form_state);
$form['form_type'] = array(
@@ -264,6 +307,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
);
}
+ /**
+ * {@inheritdoc}
+ */
function extra_options_validate($form, &$form_state) {
if (!preg_match('/^(?:[\+\-][0-9]{1,4}|[0-9]{4}):(?:[\+\-][0-9]{1,4}|[0-9]{4})$/', $form_state['values']['options']['year_range'])) {
form_error($form['year_range'], t('Date year range must be in the format -9:+9, 2005:2010, -9:2010, or 2005:+9'));
@@ -271,13 +317,18 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
}
/**
- * Add the selectors to the value form using the date handler.
+ * {@inheritdoc}
*/
function value_form(&$form, &$form_state) {
- // We use different values than the parent form, so we must
- // construct our own form element.
+ // We use different values than the parent form, so we must construct our
+ // own form element.
$form['value'] = array();
$form['value']['#tree'] = TRUE;
+ $form['value']['#id'] = 'date_views_exposed_filter-' . bin2hex(drupal_random_bytes(16));
+ $form['value']['#type'] = 'container';
+ if (module_exists('ctools')) {
+ $form['value']['#pre_render'] = array('ctools_dependent_pre_render');
+ }
// Below section copied from views_handler_filter_numeric.inc.
$which = 'all';
@@ -288,9 +339,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$identifier = $this->options['expose']['identifier'];
if (!empty($form_state['exposed'])) {
-
if (empty($this->options['expose']['use_operator']) || empty($this->options['expose']['operator_id'])) {
- // exposed and locked.
+ // Exposed and locked.
$which = in_array($this->operator, $this->operator_values(2)) ? 'minmax' : 'value';
}
else {
@@ -307,8 +357,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$form['value'] += $this->date_parts_form($form_state, 'max', $source, $which, $this->operator_values(2), $identifier, 'default_to_date');
}
- // Add some extra validation for the select widget to be sure that
- // the user inputs all parts of the date.
+ // Add some extra validation for the select widget to be sure that the user
+ // inputs all parts of the date.
if ($this->options['form_type'] == 'date_select') {
$form['value']['#element_validate'] = array('date_views_select_validate');
}
@@ -341,14 +391,15 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$label = t('Start date');
$relative_label = t('Relative start date');
break;
+
case 'max':
$label = t('End date');
$relative_label = t('Relative end date');
break;
+
default:
$label = '';
$relative_label = t('Relative date');
- break;
}
$type = $this->options['form_type'];
@@ -362,10 +413,12 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
if (!empty($form_state['exposed'])) {
// UI when the date selector is exposed.
+ $label = $this->options['expose']['label'];
$default_date = $this->date_default_value($prefix);
$id = 'edit-' . str_replace('_', '-', $this->field) . '-' . $prefix;
$form[$prefix] = array(
'#title' => check_plain($label),
+ '#title_display' => 'invisible',
'#type' => $type,
'#size' => 20,
'#default_value' => !empty($this->value[$prefix]) ? $this->value[$prefix] : $default_date,
@@ -380,7 +433,16 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$form[$prefix]['#pre_render'][] = 'ctools_dependent_pre_render';
$form[$prefix]['#dependency'] = array($source => $operator_values);
}
+
+ // Validate the input value; set form state input array.
+ $input = isset($form_state['input'][$identifier][$prefix]) ? $form_state['input'][$identifier][$prefix] : array();
+ $form_state['input'][$identifier][$prefix] = $this->input_validate($form[$prefix], $input);
+
if (!isset($form_state['input'][$identifier][$prefix])) {
+ // Handle bogus input from the query string to prevent fatal errors.
+ if (isset($form_state['input'][$identifier]) && !is_array($form_state['input'][$identifier])) {
+ $form_state['input'][$identifier] = array();
+ }
// Ensure these exist.
foreach ($granularity as $key) {
$form_state['input'][$identifier][$prefix][$key] = NULL;
@@ -438,18 +500,67 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
return $form;
}
+ /**
+ * Returns form state input array appropriate to missing, valid, and invalid input.
+ */
+ function input_validate($element, $input) {
+ if (!$input) {
+ // No input value (e.g. initial form load), set value to NULL so Form API
+ // calls the element value_callback routine with FALSE to set the '#value'
+ // property from the '#default_value' property.
+ // See _form_builder_handle_input_element().
+ if ($element['#type'] != 'date_select') {
+ return array('date' => NULL);
+ }
+ $granularity = date_format_order($element['#date_format']);
+ if ($key = array_search('timezone', $granularity)) {
+ unset($granularity[$key]);
+ }
+ return array_fill_keys($granularity, NULL);
+ }
+
+ // Include element defaults to avoid notices in the xxx_input_date routines.
+ // Copied from form_builder() in form.inc.
+ if (isset($element['#type']) && empty($element['#defaults_loaded']) && ($info = element_info($element['#type']))) {
+ // Overlay $info onto $element, retaining preexisting keys in $element.
+ $element += $info;
+ $element['#defaults_loaded'] = TRUE;
+ }
+
+ $date = NULL;
+ $function = "{$element['#type']}_input_date";
+ if (($date = $function($element, $input)) && date_is_date($date)) {
+ // The input is valid including being in the expected format.
+ return $input;
+ }
+
+ if (is_object($date)) {
+ // Input may not meet the granularity and format but is recognizable.
+ return $input;
+ }
+
+ // Input is bogus, return empty array in granularity format.
+ if ($element['#type'] != 'date_select') {
+ return array('date' => '');
+ }
+
+ $granularity = date_format_order($element['#date_format']);
+ if ($key = array_search('timezone', $granularity)) {
+ unset($granularity[$key]);
+ }
+ return array_fill_keys($granularity, '');
+ }
+
/**
* Value validation.
*
- * TODO add in more validation.
+ * @todo Add in more validation.
*
- * We are setting an extra option using a value form
- * because it makes more sense to set it there.
- * That's not the normal method, so we have to manually
+ * We are setting an extra option using a value form because it makes more
+ * sense to set it there. That's not the normal method, so we have to manually
* transfer the selected value back to the option.
*/
function value_validate($form, &$form_state) {
-
$options = &$form_state['values']['options'];
if ($options['operator'] == 'between' || $options['operator'] == 'not between') {
@@ -459,7 +570,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
}
else {
$this->options['default_date'] = $options['value']['min_group']['default_date'];
- // NULL out the value field, user wanted the relative value to take hold.
+ // NULL out the value field, user wanted the relative value to take
+ // hold.
$options['value']['min_group']['min'] = NULL;
}
}
@@ -473,7 +585,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
}
else {
$this->options['default_to_date'] = $options['value']['max_group']['default_to_date'];
- // NULL out the value field, user wanted the relative value to take hold.
+ // NULL out the value field, user wanted the relative value to take
+ // hold.
$options['value']['max_group']['max'] = NULL;
}
}
@@ -489,7 +602,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
}
else {
$this->options['default_date'] = $options['value']['value_group']['default_date'];
- // NULL out the value field, user wanted the relative value to take hold.
+ // NULL out the value field, user wanted the relative value to take
+ // hold.
$options['value']['value_group']['value'] = NULL;
}
}
@@ -512,8 +626,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
// Our date widgets do their own validation.
}
- // Update the summary values to provide
- // meaningful information for each option.
+ /**
+ * {@inheritdoc}
+ */
function admin_summary() {
$parts = $this->date_handler->date_parts();
$widget_options = $this->widget_options();
@@ -535,4 +650,3 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
}
}
-// @codingStandardsIgnoreEnd
diff --git a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc
index 1addd2000..7cdab30ac 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc
+++ b/frontend/drupal/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc
@@ -1,100 +1,88 @@
date_info values set by the argument accordingly
- * so the theme will pick up the new information.
+ * The solution used here is to let the argument create the original query. The
+ * pager query runs after that, so the pager checks to see if there is a pager
+ * value that needs to be used in the query. The date argument has identified
+ * the placeholders it used in the query. So if a change is needed, we can swap
+ * the pager value into the query created by the date argument and adjust the
+ * $view->date_info values set by the argument accordingly so the theme will
+ * pick up the new information.
*/
/**
- * Example plugin to handle paging by month.
+ * Views pager plugin to page by month.
*/
-// @codingStandardsIgnoreStart
class date_views_plugin_pager extends views_plugin_pager {
/**
- * This kind of pager does not need to count the number of records.
+ * {@inheritdoc}
*/
function use_count_query() {
return FALSE;
}
/**
- * Because we don't know how many pages there are, we never believe there are more records.
+ * {@inheritdoc}
*/
function has_more_records() {
return FALSE;
}
- /*
- * Tell Views what this pager's setting is.
+ /**
+ * {@inheritdoc}
*/
function summary_title() {
return t("Position: @position, format: @format.", array('@position' => $this->options['pager_position'], '@format' => $this->options['link_format']));
}
/**
- * Tell Views what options this plugin can store.
+ * {@inheritdoc}
*/
function option_definition() {
$options = parent::option_definition();
@@ -107,8 +95,8 @@ class date_views_plugin_pager extends views_plugin_pager {
return $options;
}
- /*
- * Provide the form for setting options.
+ /**
+ * {@inheritdoc}
*/
function options_form(&$form, &$form_state) {
$form['markup']['#markup'] = t('This pager works together with a Date or Content date field contextual filter. If a Date filter has been added to the view, this pager will provide back/next paging to match the granularity of that filter (i.e. paging by year, month, week, or day). The filter must also be configured to use a DATE default value. If there is no Date contextual filter on this view, or if it has not been set to use a default date, the pager will not appear.');
@@ -148,13 +136,11 @@ class date_views_plugin_pager extends views_plugin_pager {
}
/**
- * Transfer date information from the argument to the view so the pager theme can use it
- * and update the date argument value to whatever is set by the pager.
+ * {@inheritdoc}
*/
function query() {
-
- // By fetching our data from the exposed input, it is possible to
- // feed pager data through some method other than $_GET.
+ // By fetching our data from the exposed input, it is possible to feed
+ // pager data through some method other than $_GET.
$input = $this->view->get_exposed_input();
$value = NULL;
if (!empty($input) && !empty($input[$this->options['date_id']])) {
@@ -166,15 +152,15 @@ class date_views_plugin_pager extends views_plugin_pager {
foreach ($this->view->argument as $id => &$argument) {
if (date_views_handler_is_date($argument, 'argument')) {
- // If the argument is empty, nothing to do. This could be from
- // an argument that does not set a default value.
+ // If the argument is empty, nothing to do. This could be from an
+ // argument that does not set a default value.
if (empty($argument->argument) || empty($argument->date_handler)) {
continue;
}
- // Storing this information in the pager so it's available for summary info.
- // The view argument information is not otherwise accessible to the pager.
- // Not working right yet, tho.
+ // Storing this information in the pager so it's available for summary
+ // info. The view argument information is not otherwise accessible to
+ // the pager. Not working right yet, tho.
$date_handler = $argument->date_handler;
$this->options['date_argument'] = $id;
$this->options['granularity'] = $argument->date_handler->granularity;
@@ -189,8 +175,9 @@ class date_views_plugin_pager extends views_plugin_pager {
$this->view->build_info['fail'] = TRUE;
return;
}
- // Write date_info to store information to be used
- // in the theming functions.
+
+ // Write date_info to store information to be used in the theming
+ // functions.
if (empty($this->view->date_info)) {
$this->view->date_info = new stdClass();
}
@@ -205,8 +192,9 @@ class date_views_plugin_pager extends views_plugin_pager {
$this->view->date_info->date_pager_position = $this->options['pager_position'];
$this->view->date_info->date_pager_format = $this->options['link_format'];
$this->view->date_info->skip_empty_pages = $this->options['skip_empty_pages'] == 1;
- // Execute two additional queries to find
- // the previous and next page with values.
+
+ // Execute two additional queries to find the previous and next page
+ // with values.
if ($this->view->date_info->skip_empty_pages) {
$q = clone $argument->query;
$field = $argument->table_alias . '.' . $argument->real_field;
@@ -217,8 +205,8 @@ class date_views_plugin_pager extends views_plugin_pager {
$q->set_distinct(TRUE, TRUE);
// Date limits of this argument.
$datelimits = $argument->date_handler->arg_range($argument->limit[0] . '--' . $argument->limit[1]);
- // Find the first two dates between the minimum date
- // and the upper bound of the current value.
+ // Find the first two dates between the minimum date and the upper
+ // bound of the current value.
$q->add_orderby(NULL, $fieldsql, 'DESC', 'date');
$this->set_argument_placeholders($this->view->date_info->placeholders, $datelimits[0], $argument->max_date, $q, $format);
@@ -243,7 +231,7 @@ class date_views_plugin_pager extends views_plugin_pager {
// Set the default value of the query to $prevfirst or $nextfirst
// when there is no value and $prevsecond or $nextsecond is set.
if (empty($value)) {
- // @Todo find out which of $prevdate or $nextdate is closest to the
+ // @todo find out which of $prevdate or $nextdate is closest to the
// default argument date value and choose that one.
if ($prevdate && $prevdatealt) {
$this->set_argument_value($argument, $prevdate);
@@ -269,8 +257,8 @@ class date_views_plugin_pager extends views_plugin_pager {
}
}
else {
- // $prevdate and $nextdate are the same as $value, so move to
- // the next values.
+ // $prevdate and $nextdate are the same as $value, so move to the
+ // next values.
$prevdate = $prevdatealt;
$nextdate = $nextdatealt;
}
@@ -279,9 +267,9 @@ class date_views_plugin_pager extends views_plugin_pager {
$this->view->date_info->next_date = $nextdate ? new DateObject($nextdate, NULL, $format) : NULL;
}
else {
- $this->view->date_info->prev_date = clone($argument->min_date);
+ $this->view->date_info->prev_date = clone $argument->min_date;
date_modify($this->view->date_info->prev_date, '-1 ' . $argument->date_handler->granularity);
- $this->view->date_info->next_date = clone($argument->min_date);
+ $this->view->date_info->next_date = clone $argument->min_date;
date_modify($this->view->date_info->next_date, '+1 ' . $argument->date_handler->granularity);
}
// Write the date_info properties that depend on the current value.
@@ -296,14 +284,17 @@ class date_views_plugin_pager extends views_plugin_pager {
$i++;
}
- // Is this a view that needs to be altered based on a pager value?
- // If there is pager input and the argument has set the placeholders,
- // swap the pager value in for the placeholder set by the argument.
+ // Is this a view that needs to be altered based on a pager value? If there
+ // is pager input and the argument has set the placeholders, swap the pager
+ // value in for the placeholder set by the argument.
if (!empty($value) && !empty($this->view->date_info->placeholders)) {
$this->set_argument_placeholders($this->view->date_info->placeholders, $this->view->date_info->min_date, $this->view->date_info->max_date, $this->view->query, $format);
}
}
+ /**
+ * {@inheritdoc}
+ */
function set_argument_value($argument, $value) {
$argument->argument = $value;
$argument->date_range = $argument->date_handler->arg_range($value);
@@ -314,6 +305,9 @@ class date_views_plugin_pager extends views_plugin_pager {
$argument->is_default = FALSE;
}
+ /**
+ * {@inheritdoc}
+ */
function set_argument_placeholders($placeholders, $mindate, $maxdate, $query, $format) {
$count = count($placeholders);
foreach ($query->where as $group => $data) {
@@ -321,8 +315,8 @@ class date_views_plugin_pager extends views_plugin_pager {
if (array_key_exists('value', $condition) && is_array($condition['value'])) {
foreach ($condition['value'] as $placeholder => $placeholder_value) {
if (array_key_exists($placeholder, $placeholders)) {
- // If we didn't get a match, this is a > $min < $max query that uses the view
- // min and max dates as placeholders.
+ // If we didn't get a match, this is a > $min < $max query that
+ // uses the view min and max dates as placeholders.
$date = ($count == 2) ? $mindate : $maxdate;
$next_placeholder = array_shift($placeholders);
$query->where[$group]['conditions'][$delta]['value'][$placeholder] = $date->format($format);
@@ -335,7 +329,7 @@ class date_views_plugin_pager extends views_plugin_pager {
}
/**
- * Add a callback to determine if we have moved outside the valid date range for this argument.
+ * Determine if we have moved outside the valid date range for this argument.
*/
function date_forbid($argument) {
// See if we're outside the allowed date range for our argument.
@@ -346,11 +340,22 @@ class date_views_plugin_pager extends views_plugin_pager {
return FALSE;
}
+ /**
+ * {@inheritdoc}
+ */
+ function pre_render(&$result) {
+ // Load theme functions for the pager.
+ module_load_include('inc', 'date_views', 'theme/theme');
+ }
+ /**
+ * {@inheritdoc}
+ */
function render($input) {
- // This adds all of our template suggestions based upon the view name and display id.
+ // This adds all of our template suggestions based upon the view name and
+ // display id.
$pager_theme = views_theme_functions('date_views_pager', $this->view, $this->display);
return theme($pager_theme, array('plugin' => $this, 'input' => $input));
}
+
}
-// @codingStandardsIgnoreEnd
diff --git a/frontend/drupal/sites/all/modules/date/date_views/tests/date_views_filter.test b/frontend/drupal/sites/all/modules/date/date_views/tests/date_views_filter.test
new file mode 100644
index 000000000..70d163e38
--- /dev/null
+++ b/frontend/drupal/sites/all/modules/date/date_views/tests/date_views_filter.test
@@ -0,0 +1,515 @@
+ 'Date Views - Filter Test',
+ 'description' => 'Tests date filter handler in Views, including Date Popup fields.',
+ 'group' => 'Date Views',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp(array $modules = array()) {
+ $modules[] = 'views_ui';
+ $modules[] = 'date_views';
+ $modules[] = 'date_popup';
+ parent::setUp($modules);
+
+ // Initialize values.
+ $this->initialize();
+
+ // Reset/rebuild all data structures after enabling the modules.
+ $this->resetAll();
+
+ // Create a date field.
+ $this->createDateField();
+
+ // Create sample nodes.
+ $this->createDateContent();
+ }
+
+ /**
+ * Initialize test values.
+ */
+ public function initialize() {
+ $this->config_url = 'admin/structure/views/nojs/config-item/test_date_filters/default/filter';
+ $this->extra_url = 'admin/structure/views/nojs/config-item-extra/test_date_filters/default/filter';
+
+ // This is used in views configuration and on the view page.
+ variable_set('date_format_short', 'Y-m-d H:i');
+
+ if ($this->privileged_user) {
+ // Add required permissions.
+ $roles = $this->privileged_user->roles;
+ unset($roles[2]);
+ $rid = key($roles);
+ $permissions = array('administer views'/*, 'administer site configuration'*/);
+ user_role_grant_permissions($rid, $permissions);
+ }
+ }
+
+ /**
+ * Adds a date field to a node bundle.
+ */
+ public function createDateField($values = array()) {
+ // Create a date field.
+ $values = array(
+ 'label' => 'Sample date',
+ 'widget_type' => 'date_select',
+ 'field_name' => 'sample_date',
+ 'field_type' => 'datetime',
+ 'input_format' => 'm/d/Y - H:i:s',
+ 'granularity' => array('year', 'month', 'day'),
+ );
+ parent::createDateField($values);
+ }
+
+ /**
+ * Saves content with a date field.
+ */
+ public function createDateContent() {
+ $years = range(date('Y') - 3, date('Y') + 3);
+ foreach ($years as $year) {
+ for($month = 1; $month < 13; $month++) {
+ $node = array(
+ 'type' => 'story',
+ 'title' => "Story from $year-$month-01",
+ 'uid' => '1',
+ );
+ $node['sample_date']['und'][0]['value'] = "$year-$month-01";
+ node_save((object) $node);
+ }
+ }
+ }
+
+ /**
+ * Creates a view with a date filter for each date widget type.
+ */
+ public function createDateFilterView() {
+ if ($view = views_get_view('test_date_filters')) {
+ // Delete view, then recreate it in a known state.
+ views_delete_view($view);
+ }
+
+ // Create the view.
+ $view = new view();
+ $view->name = 'test_date_filters';
+ $view->description = '';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Test date filters';
+ $view->core = 7;
+ $view->api_version = '3.0';
+ $view->disabled = FALSE;
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['title'] = 'Date filters';
+ $handler->display->display_options['use_more_always'] = FALSE;
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['exposed_form']['options']['reset_button'] = TRUE;
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = '10';
+ $handler->display->display_options['style_plugin'] = 'table';
+ $handler->display->display_options['style_options']['columns'] = array(
+ 'nid' => 'nid',
+ 'title' => 'title',
+ 'sample_date' => 'sample_date',
+ );
+ $handler->display->display_options['style_options']['default'] = '-1';
+ $handler->display->display_options['style_options']['info'] = array(
+ 'nid' => array(
+ 'sortable' => 0,
+ 'default_sort_order' => 'asc',
+ 'align' => '',
+ 'separator' => '',
+ 'empty_column' => 0,
+ ),
+ 'title' => array(
+ 'sortable' => 0,
+ 'default_sort_order' => 'asc',
+ 'align' => '',
+ 'separator' => '',
+ 'empty_column' => 0,
+ ),
+ 'sample_date' => array(
+ 'sortable' => 1,
+ 'default_sort_order' => 'asc',
+ 'align' => '',
+ 'separator' => '',
+ 'empty_column' => 0,
+ ),
+ );
+ /* Field: Content: Nid */
+ $handler->display->display_options['fields']['nid']['id'] = 'nid';
+ $handler->display->display_options['fields']['nid']['table'] = 'node';
+ $handler->display->display_options['fields']['nid']['field'] = 'nid';
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['label'] = '';
+ $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
+ $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
+ /* Field: Content: Sample date */
+ $handler->display->display_options['fields']['sample_date']['id'] = 'sample_date';
+ $handler->display->display_options['fields']['sample_date']['table'] = 'field_data_sample_date';
+ $handler->display->display_options['fields']['sample_date']['field'] = 'sample_date';
+ $handler->display->display_options['fields']['sample_date']['settings'] = array(
+ 'format_type' => 'short',
+ 'custom_date_format' => '',
+ 'fromto' => 'both',
+ 'multiple_number' => '',
+ 'multiple_from' => '',
+ 'multiple_to' => '',
+ 'show_remaining_days' => 0,
+ 'show_repeat_rule' => 'show',
+ );
+ /* Filter criterion: Content: Type */
+ $handler->display->display_options['filters']['type']['id'] = 'type';
+ $handler->display->display_options['filters']['type']['table'] = 'node';
+ $handler->display->display_options['filters']['type']['field'] = 'type';
+ $handler->display->display_options['filters']['type']['value'] = array(
+ 'story' => 'story',
+ );
+ $handler->display->display_options['filters']['type']['group'] = 1;
+ /* Filter criterion: Content: Sample date (sample_date) */
+ $handler->display->display_options['filters']['sample_date_select']['id'] = 'sample_date_select';
+ $handler->display->display_options['filters']['sample_date_select']['table'] = 'field_data_sample_date';
+ $handler->display->display_options['filters']['sample_date_select']['field'] = 'sample_date_value';
+ $handler->display->display_options['filters']['sample_date_select']['group'] = 1;
+ $handler->display->display_options['filters']['sample_date_select']['exposed'] = TRUE;
+ $handler->display->display_options['filters']['sample_date_select']['expose']['operator_id'] = 'sample_date_select_op';
+ $handler->display->display_options['filters']['sample_date_select']['expose']['label'] = 'Select filter';
+ $handler->display->display_options['filters']['sample_date_select']['expose']['operator'] = 'sample_date_select_op';
+ $handler->display->display_options['filters']['sample_date_select']['expose']['identifier'] = 'sample_date_select';
+ $handler->display->display_options['filters']['sample_date_select']['expose']['remember_roles'] = array(
+ 2 => 0,
+ 1 => 0,
+ );
+ $handler->display->display_options['filters']['sample_date_select']['granularity'] = 'month';
+ $handler->display->display_options['filters']['sample_date_select']['year_range'] = '-2:+2';
+ /* Filter criterion: Content: Sample date (sample_date) */
+ $handler->display->display_options['filters']['sample_date_text']['id'] = 'sample_date_text';
+ $handler->display->display_options['filters']['sample_date_text']['table'] = 'field_data_sample_date';
+ $handler->display->display_options['filters']['sample_date_text']['field'] = 'sample_date_value';
+ $handler->display->display_options['filters']['sample_date_text']['group'] = 1;
+ $handler->display->display_options['filters']['sample_date_text']['exposed'] = TRUE;
+ $handler->display->display_options['filters']['sample_date_text']['expose']['operator_id'] = 'sample_date_text_op';
+ $handler->display->display_options['filters']['sample_date_text']['expose']['label'] = 'Text filter';
+ $handler->display->display_options['filters']['sample_date_text']['expose']['operator'] = 'sample_date_text_op';
+ $handler->display->display_options['filters']['sample_date_text']['expose']['identifier'] = 'sample_date_text';
+ $handler->display->display_options['filters']['sample_date_text']['expose']['remember_roles'] = array(
+ 2 => 0,
+ 1 => 0,
+ );
+ $handler->display->display_options['filters']['sample_date_text']['granularity'] = 'month';
+ $handler->display->display_options['filters']['sample_date_text']['form_type'] = 'date_text';
+ $handler->display->display_options['filters']['sample_date_text']['year_range'] = '-2:+2';
+ /* Filter criterion: Content: Sample date (sample_date) */
+ $handler->display->display_options['filters']['sample_date_popup']['id'] = 'sample_date_popup';
+ $handler->display->display_options['filters']['sample_date_popup']['table'] = 'field_data_sample_date';
+ $handler->display->display_options['filters']['sample_date_popup']['field'] = 'sample_date_value';
+ $handler->display->display_options['filters']['sample_date_popup']['group'] = 1;
+ $handler->display->display_options['filters']['sample_date_popup']['exposed'] = TRUE;
+ $handler->display->display_options['filters']['sample_date_popup']['expose']['operator_id'] = 'sample_date_popup_op';
+ $handler->display->display_options['filters']['sample_date_popup']['expose']['label'] = 'Popup filter';
+ $handler->display->display_options['filters']['sample_date_popup']['expose']['operator'] = 'sample_date_popup_op';
+ $handler->display->display_options['filters']['sample_date_popup']['expose']['identifier'] = 'sample_date_popup';
+ $handler->display->display_options['filters']['sample_date_popup']['expose']['remember_roles'] = array(
+ 2 => 0,
+ 1 => 0,
+ );
+ $handler->display->display_options['filters']['sample_date_popup']['granularity'] = 'month';
+ $handler->display->display_options['filters']['sample_date_popup']['form_type'] = 'date_popup';
+ $handler->display->display_options['filters']['sample_date_popup']['year_range'] = '-2:+2';
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page_samples');
+ $handler->display->display_options['path'] = 'test-date-filter';
+ $handler->display->display_options['menu']['type'] = 'normal';
+ $handler->display->display_options['menu']['title'] = 'Date filters';
+ $handler->display->display_options['menu']['weight'] = '0';
+ $handler->display->display_options['menu']['context'] = 0;
+ $handler->display->display_options['menu']['context_only_inline'] = 0;
+
+ $view->save();
+ }
+
+ /**
+ * Test date filters.
+ */
+ public function testDateFilters() {
+ if (!$this->loggedInUser) {
+ return;
+ }
+
+ try {
+ $this->checkSelectFilter();
+ $this->checkTextFilter('sample_date_text');
+ $this->checkTextFilter('sample_date_popup');
+
+ // @todo Seems to be a bug in popup code that reuses the last filter value
+ // so that query condition is invalid.
+ // (DATE_FORMAT(field_data_sample_date.sample_date_value, '%Y') = '2018-06')
+ $this->validateFilters();
+ }
+ catch(Exception $e) {
+ }
+
+ if ($this->loggedInUser) {
+ $this->drupalLogout();
+ }
+ }
+
+ /**
+ * Test date filter using select widget.
+ */
+ public function checkSelectFilter() {
+ // Restore the view.
+ $this->createDateFilterView();
+
+ $year = (string) (date('Y') - 1);
+ $month = '06';
+ $filter = 'sample_date_select';
+
+ // Set the filter value.
+ $edit = array(
+ 'options[value][value_group][value][year]' => $year,
+ 'options[value][value_group][value][month]' => substr($month, -1),
+ );
+ $this->setFilter($filter, $edit);
+
+ // Inspect the table.
+ $this->checkTable(1, $year);
+
+ // Inspect the filter value.
+ $this->checkSelect($filter, 'year', $year);
+ $this->checkSelect($filter, 'month', substr($month, -1));
+
+ // Change granularity.
+ $this->setGranularity($filter, 'year');
+
+ // Inspect the table.
+ $this->checkTable(10, $year);
+
+ // Inspect the filter value.
+ $this->checkSelect($filter, 'year', $year);
+ }
+
+ /**
+ * Test date filter using text or popup widget.
+ *
+ * @param string $filter
+ * Filter name.
+ */
+ public function checkTextFilter($filter) {
+ // Restore the view.
+ $this->createDateFilterView();
+
+ $year = (string) (date('Y') - 1);
+ $month = '06';
+
+ // Set the filter value.
+ $edit = array(
+ 'options[value][value_group][value][date]' => "$year-$month",
+ );
+ $this->setFilter($filter, $edit);
+
+ // Inspect the table.
+ $this->checkTable(1, $year);
+
+ // Inspect the filter value.
+ $this->checkTextField($filter, "$year-$month");
+
+ // Change granularity.
+ $this->setGranularity($filter, 'year');
+
+ // Set the filter value.
+ // This is not necessary with the text widget but is with the popup widget.
+ // The popup element retains the first value and the views query uses it.
+ $edit = array(
+ 'options[value][value_group][value][date]' => "$year",
+ );
+ $this->setFilter($filter, $edit);
+
+ // Inspect the table.
+ $this->checkTable(10, $year);
+
+ // Inspect the filter value.
+ $this->checkTextField($filter, $year);
+ }
+
+ /**
+ * Test date filter validation using all widgets.
+ */
+ public function validateFilters() {
+ // Restore the view.
+ $this->createDateFilterView();
+
+ $year = (string) (date('Y') - 1);
+ $month = '06';
+
+ // Set the filter values.
+ $edit = array(
+ 'sample_date_select[value][year]' => $year,
+ 'sample_date_text[value][date]' => $year,
+ 'sample_date_popup[value][date]' => $year,
+ );
+
+ // View the page.
+ // The views exposed form uses a GET method not POST.
+ $options = array('query' => $edit);
+ $this->drupalGet('test-date-filter', $options);
+
+ $messages = array(
+ 'The value input for field Select filter is invalid',
+ 'The month is missing',
+ 'The value input for field Text filter is invalid',
+ "The value $year does not match the expected format",
+ 'The value input for field Popup filter is invalid',
+ "The value $year does not match the expected format",
+ );
+ foreach ($messages as $message) {
+ $this->assertText($message, "Found error message: {$message}");
+ }
+ }
+
+ /**
+ * Set value of a date filter.
+ *
+ * @param string $filter
+ * Filter name.
+ * @param string $edit
+ * The associative array of form input values.
+ */
+ public function setFilter($filter, $edit) {
+ // Load view configuration dialog.
+ $this->drupalGet($this->config_url . '/' . $filter);
+ $this->drupalPost(NULL, $edit, t('Apply'));
+
+ // Save the view.
+ $edit = array();
+ $this->drupalPost(NULL, $edit, t('Save'));
+ }
+
+ /**
+ * Set granularity of a date filter.
+ *
+ * @param string $filter
+ * Filter name.
+ * @param string $granularity
+ * The granularity value.
+ */
+ public function setGranularity($filter, $granularity) {
+ // Load view configuration dialog.
+ $this->drupalGet($this->extra_url . '/' . $filter);
+ $edit = array(
+ 'options[granularity]' => $granularity,
+ );
+ $this->drupalPost(NULL, $edit, t('Apply'));
+
+ // Save the view.
+ $edit = array();
+ $this->drupalPost(NULL, $edit, t('Save'));
+ }
+
+ /**
+ * Inspect the select field[s] of a date filter.
+ *
+ * @param string $filter
+ * Filter name.
+ * @param string $part
+ * Date part.
+ * @param string $expected
+ * The expected field value.
+ */
+ public function checkSelect($filter, $part, $expected) {
+ // Inspect the filter value.
+ $xpath = '//select[@name="' . $filter . '[value][' . $part . ']"]';
+ $elements = $this->xpath($xpath);
+ if (is_array($elements)) {
+ $select = $elements[0];
+ $value = $this->getSelectedItem($select);
+ $this->assertEqual($value, $expected, "Filter contains $expected");
+ }
+ else {
+ $this->assertTrue(FALSE, "Filter does NOT contain $expected");
+ }
+ }
+
+ /**
+ * Inspect the text field of a date filter.
+ *
+ * @param string $filter
+ * Filter name.
+ * @param string $expected
+ * The expected field value.
+ */
+ public function checkTextField($filter, $expected) {
+ // Inspect the filter value.
+ $xpath = '//input[@name="' . $filter . '[value][date]"]';
+ $elements = $this->xpath($xpath);
+ if (is_array($elements)) {
+ $value = (array) $elements[0];
+ $value = $value['@attributes']['value'];
+ $this->assertEqual($value, $expected, "Filter contains $expected");
+ }
+ else {
+ $this->assertTrue(FALSE, "Filter does NOT contain $expected");
+ }
+ }
+
+ /**
+ * Inspect contents of view output table.
+ *
+ * @param int $count
+ * Expected number of rows in table.
+ * @param string $year
+ * Expected year value in cells of table.
+ */
+ public function checkTable($count, $year) {
+ // View the page.
+ $this->drupalGet('test-date-filter');
+
+ // Count rows in table.
+ $xpath = '//table[contains(@class, "views-table")]//tbody//tr';
+ $elements = $this->xpath($xpath);
+ if (is_array($elements)) {
+ $this->assertEqual(count($elements), $count, "Table contains $count rows for $year");
+ }
+ else {
+ $this->assertTrue(FALSE, "Table is empty for $year");
+ }
+
+ // Check values in table.
+ // views-field views-field-sample-date
+ $xpath = '//td[contains(@class, "views-field-sample-date")]//span';
+ $elements = $this->xpath($xpath);
+ if (is_array($elements)) {
+ foreach ($elements as $key => $element) {
+ $row = $key + 1;
+ $this->assertTrue(strpos((string) $element, $year) !== FALSE, "Year in row $row is $year");
+ }
+ }
+ else {
+ $this->assertTrue(FALSE, "Table rows are empty for $year");
+ }
+ }
+
+}
diff --git a/frontend/drupal/sites/all/modules/date/date_views/tests/date_views_pager.test b/frontend/drupal/sites/all/modules/date/date_views/tests/date_views_pager.test
new file mode 100644
index 000000000..f165076f5
--- /dev/null
+++ b/frontend/drupal/sites/all/modules/date/date_views/tests/date_views_pager.test
@@ -0,0 +1,137 @@
+ 'Date views pager skipping test',
+ 'description' => "Views date pager, option to skip empty pages test",
+ 'group' => 'Date',
+ 'dependencies' => array('ctools', 'views'),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp(array $modules = array()) {
+ $modules[] = 'date_views';
+ $modules[] = 'ctools';
+ $modules[] = 'views';
+ $modules[] = 'views_ui';
+ parent::setUp($modules);
+
+ // Create admin user and login.
+ $perms = array('administer views', 'administer site configuration');
+ $admin_user = $this->drupalCreateUser($perms);
+ $this->drupalLogin($admin_user);
+
+ // Create a new view for test.
+ $view = new view();
+ $view->name = 'test_date_pager';
+ $view->description = '';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'test_date_pager';
+ $view->core = 7;
+ $view->api_version = '3.0';
+ $view->disabled = FALSE; /* Edit this to TRUE to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['title'] = 'test_date_pager';
+ $handler->display->display_options['use_more_always'] = FALSE;
+ $handler->display->display_options['access']['type'] = 'perm';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'date_views_pager';
+ $handler->display->display_options['pager']['options']['skip_empty_pages'] = 1;
+ $handler->display->display_options['style_plugin'] = 'default';
+ $handler->display->display_options['row_plugin'] = 'node';
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['label'] = '';
+ $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
+ $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
+ /* Sort criterion: Content: Post date */
+ $handler->display->display_options['sorts']['created']['id'] = 'created';
+ $handler->display->display_options['sorts']['created']['table'] = 'node';
+ $handler->display->display_options['sorts']['created']['field'] = 'created';
+ $handler->display->display_options['sorts']['created']['order'] = 'DESC';
+ /* Contextual filter: Date: Date (node) */
+ $handler->display->display_options['arguments']['date_argument']['id'] = 'date_argument';
+ $handler->display->display_options['arguments']['date_argument']['table'] = 'node';
+ $handler->display->display_options['arguments']['date_argument']['field'] = 'date_argument';
+ $handler->display->display_options['arguments']['date_argument']['default_action'] = 'default';
+ $handler->display->display_options['arguments']['date_argument']['default_argument_type'] = 'date';
+ $handler->display->display_options['arguments']['date_argument']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['date_argument']['granularity'] = 'hour';
+ $handler->display->display_options['arguments']['date_argument']['date_fields'] = array(
+ 'node.created' => 'node.created',
+ );
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = 1;
+ $handler->display->display_options['filters']['status']['group'] = 1;
+ $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page_1');
+ $handler->display->display_options['path'] = 'test_date_pager';
+
+ $view->save();
+ }
+
+ /**
+ * Test pager skipping.
+ */
+ public function testPagerSkipping() {
+ // Go to view admin page.
+ $this->drupalGet('admin/structure/views/view/display/test_date_pager/edit');
+ // Go to pager options.
+ $this->drupalGet('admin/structure/views/nojs/display/test_date_pager/default/pager_options');
+ // Check if "Skip empty pages" text - exist.
+ $this->assertText('Skip empty pages');
+ // Check if field and it's value is correct.
+ $this->assertFieldByName('pager_options[skip_empty_pages]', '1');
+ // Go back to view admin page.
+ $this->drupalGet('admin/structure/views/view/display/test_date_pager/edit');
+ // Check if pager on empty page are gone.
+ $this->assertNoText('« Prev', 'Previous pager does not exist');
+ $this->assertNoText('Next »', 'Next pager does not exist');
+ }
+
+ /**
+ * Test the view page has no PHP warnings.
+ */
+ public function testPagerWarning() {
+ $this->drupalCreateNode(array('type' => 'blog'));
+
+ // Set pager to skip empty pages.
+ $edit = array(
+ 'pager_options[skip_empty_pages]' => FALSE,
+ );
+ $this->drupalPost('admin/structure/views/nojs/display/test_date_pager/default/pager_options', $edit, t('Apply'));
+
+ // Save the view.
+ $this->drupalPost('admin/structure/views/view/test_date_pager/edit', array(), t('Save'));
+
+ // Visit view page. This will throw error, if any PHP warnings or errors.
+ $this->drupalGet('test_date_pager');
+ }
+
+}
diff --git a/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php b/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php
index ad638c102..efc7eb4c9 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php
+++ b/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php
@@ -4,18 +4,18 @@
* @file
* Template to display the Views date filter form.
*
- * Values available vary depending on the operator. The availability
- * of date vs adjustment depending on the filter settings. It can
- * be date-only, date and adjustment, or adjustment only.
+ * Values available vary depending on the operator. The availability of date vs
+ * adjustment depending on the filter settings. It can be date-only, date and
+ * adjustment, or adjustment only.
*
- * If the operator is anything but 'Is between' or 'Is not between',
- * a single date and adjustment field is available.
+ * If the operator is anything but 'Is between' or 'Is not between', a single
+ * date and adjustment field is available.
*
* $date
* $adjustment
*
- * If the operator is 'Is between' or 'Is not between',
- * two date and adjustment fields are available.
+ * If the operator is 'Is between' or 'Is not between', two date and adjustment
+ * fields are available.
*
* $mindate
* $minadjustment
@@ -28,28 +28,27 @@
*/
?>
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php b/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php
index ac8cfb4ee..4de773d68 100644
--- a/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php
+++ b/frontend/drupal/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php
@@ -1,33 +1,33 @@
view
* The view object for this navigation.
*
* $nav_title
- * The formatted title for this view. In the case of block
- * views, it will be a link to the full view, otherwise it will
- * be the formatted name of the year, month, day, or week.
+ * The formatted title for this view. In the case of block views, it will be a
+ * link to the full view, otherwise it will be the formatted name of the year,
+ * month, day, or week.
*
* $prev_url
* $next_url
- * Urls for the previous and next calendar pages. The links are
- * composed in the template to make it easier to change the text,
- * add images, etc.
+ * Urls for the previous and next calendar pages. The links are composed in
+ * the template to make it easier to change the text, add images, etc.
*
* $prev_options
* $next_options
- * Query strings and other options for the links that need to
- * be used in the l() function, including rel=nofollow.
+ * Query strings and other options for the links that need to be used in the
+ * l() function, including rel=nofollow.
*/
?>
-
+