Problem/Motivation

As shown in #2699895: Add settings to define #date_increment for datetime and datetime_range 'default' widgets, the Drupal 7 date module allowed the site builder to configure which granularity to collect:

For example, on my personal site, I have a project NodeType which has a "time range" date field that only cares about year + month granularity. Example: https://wimleers.com/work/project/cdn-far-future-expiration-drupal-7 and https://wimleers.com/work/project/ledgrid.

There are some values like 2008-00-00T00:00 and 2006-10-00T00:00 in the D7 datatabase, which cause a hard failure during migration:

Proposed resolution

Make \Drupal\migrate\Plugin\migrate\process\FormatDate::transform() detect -00-00T and -00T ISO8601 timestamps and transform to valid values.

This then results in the following DB tables in D8:

Remaining tasks

TBD

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

TBD

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
972.01 KB
1.11 KB
Wim Leers’s picture

Issue tags: +Needs tests
Wim Leers’s picture

Component: datetime.module » migration system

Been told that I should put this in migration system :)

heddn’s picture

Status: Needs review » Needs work

NW because needs tests.

jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
1 KB
2 KB

Added tests.

The last submitted patch, 6: 3095195-6-test-only.patch, failed testing. View results

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Tests added. Thanks for picking that up @jofitz.

Wim Leers’s picture

Many thanks, @jofitz! ❤️

The last submitted patch, 6: 3095195-6-test-only.patch, failed testing. View results

heddn’s picture

Uploading a new copy of #6 so we don't have the testbot keep running the test only patch.

  • webchick committed 92a0b41 on 9.0.x
    Issue #3095195 by jofitz, Wim Leers, heddn: Drupal 7 date fields...

  • webchick committed 50c5e2d on 8.9.x
    Issue #3095195 by jofitz, Wim Leers, heddn: Drupal 7 date fields...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 9.0.x; 8.9.x; 8.8.x. Thanks!

  • webchick committed 8b09954 on 8.8.x
    Issue #3095195 by jofitz, Wim Leers, heddn: Drupal 7 date fields...
webchick’s picture

Version: 8.9.x-dev » 8.8.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.