Problem/Motivation

This issue is a contribution of a test, which can check if an error is thrown when a later start date is entered for a date range, compared to the end date.

Steps to reproduce

  1. Run tests for the module
  2. Observe there is no check for an error when a later start date is entered for a date range

Proposed resolution

Creation of a test.

Remaining tasks

I will be submitting a code change with a test, then request a review to have the test merged.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Issue fork smart_date-3432819

Command icon 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

chadhester created an issue. See original summary.

chadhester’s picture

Status: Active » Needs review

I may need to create a separate issue to handle the missing schema definition, which causes an error when running this test.

chadhester’s picture

Assigned: chadhester » Unassigned

Confirming that an error is thrown if the test is run:

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for field.field.node.smart_date_content.field_date with the following errors: field.field.node.smart_date_content.field_date:default_value.0.default_end_date_type missing schema, field.field.node.smart_date_content.field_date:default_value.0.default_end_date missing schema

I can put the fix in another dependent issue:

chadhester@example-d10-web:/var/www/html/web/modules/contrib/smart_date$ git diff config/schema/smart_date.schema.yml 
diff --git a/config/schema/smart_date.schema.yml b/config/schema/smart_date.schema.yml
index 53d9410..930e05d 100644
--- a/config/schema/smart_date.schema.yml
+++ b/config/schema/smart_date.schema.yml
@@ -38,6 +38,12 @@ field.value.smartdate:
     default_date:
       type: string
       label: 'Default start date value'
+    default_end_date_type:
+      type: string
+      label: 'Default end date type'
+    default_end_date:
+      type: string
+      label: 'Default end date value'
     min:
       type: string
       label: 'Minimum Date'

nicxvan made their first commit to this issue’s fork.

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

This test looks great to me.
I resolved my last comment by updating sooner to earlier for minor semantic reasons, I didn't want to block progress on this for that issue.

Assuming tests still pass, I'm marking this as RTBC.

mandclu made their first commit to this issue’s fork.

  • mandclu committed 4c35ed4f on 4.1.x authored by chadhester
    Issue #3432819 by chadhester, nicxvan, ultimike: Test for a later start...

mandclu credited ultimike.

mandclu’s picture

Status: Reviewed & tested by the community » Fixed

This has been merged in. Thanks for everyone's work on this!

Status: Fixed » Closed (fixed)

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

nicxvan’s picture