Problem/Motivation
We added pre-epoch date support on #3189051: Handle pre-epoch dates, however on 8.0.x we don't have full_date data type.
Proposed resolution
Either:
- Add full_date data type to 8.0.x
- Add on existing update hook the task to convert full_date to "string" (see: #3189051-16: Handle pre-epoch dates)
Remaining tasks
Write initial patch(done by @ckontakis in merge request !89)Add tests- done by @kdborg and @mparker17 by #11Review and feedback- done by @mparker17 in #10RTBC and feedback- done by @mparker17 in #10Commit- done by @mparker17 in #12Release- released by @mparker17 in 8.0.0-alpha5
User interface changes
Adds a new field type, Full Date (machine name elasticsearch_connector_full_date) to the Index's field configuration UI.
API changes
Adds an @SearchApiDataType with ID elasticsearch_connector_full_date and makes it available to the field mapper.
Adds an update hook (elasticsearch_connector_update_9804()) that changes fields of type full_date into elasticsearch_connector_full_date fields instead.
Data model changes
One-time changes fields of type full_date into elasticsearch_connector_full_date fields instead via update hook.
| Comment | File | Size | Author |
|---|
Issue fork elasticsearch_connector-3470901
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
kdborg@gmail.com commentedHere's a patch for the changes proposed above. This works with both the local elastic search instance and an ElasticCloud instance using the patch here: https://www.drupal.org/project/elasticsearch_connector/issues/3522107#co...
Comment #5
sokru commentedThanks for working on this! Now that we have almost 1000 installs on 8.x branch, I'd be a little cautious to add a new update hook. The issue summary suggest adding it to existing one, so it would work for people coming from 8.x-7.x branch. People already on 8.x branch have probably done this by custom module.
Also the new full_date plugin does not have same logic as 8.x-7.x branch (see https://git.drupalcode.org/project/elasticsearch_connector/-/commit/b4f2...).
We should add tests for this feature.
Comment #6
kdborg@gmail.com commentedI've removed the hook_update from the install file. See attached.
Comment #7
mparker17The patch looks good, but as @sokru pointed out, it needs tests. Automated tests ultimately benefit you (and your client(s)): they ensure future changes will not break the functionality your site depends on.
If you need help writing tests, please ask us!
Comment #8
mparker17Updating issue summary
Comment #9
mparker17Link to merge request in issue summary.
Comment #10
mparker17Testbot likes it except for a PHPStan lint, and my manual testing shows it is working, so this works for me: let's fix the PHPStan lint and see if we can add a test.
(additional context: @kdborg and i are pair-programming on this issue in real time)
Comment #11
mparker17I've added a test now, so I think I'm going to promote this to RTBC.
Comment #13
mparker17Merged! Thank you very much everyone!
Comment #15
mparker17Comment #17
mparker17Released in 8.0.0-alpha5!