Advertisement
Guest User

Views integration for the Datetime Range module

a guest
Oct 6th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. Description:
  2.  
  3. In Drupal 8.2.x through 8.4.x, the Datetime Range module's fields did not use the same views integration as core datetime fields. This meant that they did not support features like year- or month-only formats for Views fields, regular expressions for Views filters, and so on.
  4. In Drupal 8.5.x, the Views integration for Datetime Range fields is updated to extend that of other datetime fields.
  5.  
  6. You are affected by this change if you have a Views that configure a field, filter criteria, or sort criteria for a Datetime Range field, or if you have a module that extends the Views integration for Datetime Range fields. When you update to Drupal 8.5.0, existing views that contain Datetime Range fields, filters, or sorts will be automatically updated to use datetime fields instead by running database updates.
  7.  
  8. Important upgrade information
  9.  
  10. Although the automatic updates will take care of the migration between the old plugin format to the new one, site builders and developers should check the Views still list the expected results.
  11.  
  12. As a site builder / developer
  13.  
  14. At the end of the database updates a message will list the modified Views names/id, if any. [we can add the screenshot https://www.drupal.org/files/issues/datetime_range_update_info.png]
  15.  
  16. Modules containing on its default configuration any Views using the old Datetime Range plugins types will benefit of the automatic migration on installing the module or - better - on saving the Views. If you are the maintainer of the module you must re-export the Views configuration with the new plugins types, as the automatic update on saving Views will be removed before 9.0.0 .
  17.  
  18. As a developer
  19. As the operators between old (string/standard) and new (datetime) plugins are different, we take some assumption you may want to review. The update will map existing datetime_range views string plugins operators/values according with this list:
  20.  
  21. = maps to =, value is unchanged
  22. != maps to !=, value is unchanged
  23. not maps to !=, value is unchanged
  24. starts maps to regular_expression, value is prefixed with '^'
  25. ends maps to regular_expression, value is suffixed with '$'
  26. any other operator (contains, word, allwords, not_starts, not_ends, shorterthan, longerthan, regular_expression) maps to regular_expression, value is unchanged if not empty otherwise *. is used
  27.  
  28. UI changes:
  29. There are no new UI elements. Existing Views filter and sort plugins against datetime_range fileds will now use the datetime widgets. The change is automatic, site-builders and developers don't need to do any action.
  30. See the example below of how the UI will change for a Views filter plugin against a datetime_range field:
  31. [screenshots]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement