Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict in date constraints when one date is deleted #128

Open
jaragunde opened this issue Mar 9, 2016 · 4 comments
Open

Conflict in date constraints when one date is deleted #128

jaragunde opened this issue Mar 9, 2016 · 4 comments

Comments

@jaragunde
Copy link
Member

[Trac import]
Reported by: jaragunde
Original date: Thursday, 30 December 2010 11:54

Steps to reproduce the bug:

  1. Go to Users -> Personal Page
  2. Set start date: 01/01/2011
  3. As expected, end date field prevents you from setting dates prior to 01/01/2011.
  4. Delete start date.
  5. End date still prevents dates before 01/01/2011.

As it can be deducted, the problem is that date constraints are updated after a change but not after a deletion.

This bug can probably affect other pairs of start date/end date inputs in other screens of the application.

@jaragunde
Copy link
Member Author

[Trac import]
Comment by: jaragunde
Original date: Wednesday, 26 November 2014 20:03

The code for the validator called "daterange" in web/include/validations.js is not prepared to take this case into account. But that's irrelevant because execution will never reach that code: "allowBlank" attribute in the date fields is set to true, and the validation code in ExtJS !DateField checks the value of allowBlank in first place; if it's true then it's considered a valid value and code returns at that point, without running the validator.

Essentially, the root of the problem is that we are using a mechanism intended for validation with the intention of setting interdependent restrictions between fields.

@jaragunde
Copy link
Member Author

[Trac import]
Comment by: jaragunde
Original date: Wednesday, 26 November 2014 20:10

commit 7781cd22ec8923b9c2315898fa91c0ff1c72daff
Author: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Date:   Wed Nov 26 20:05:48 2014 +0100

    [#128] Reimplement date range constraints in DateIntervalForm

    Instead of using the validation mechanism to implement the date range
    constraints, we implement it in the change event.

    Doing that, we work around the problem that caused the bug #128: the
    allowBlank attribute set to true directly marked the field as valid
    when setting it empty, preventing our custom validation code, which
    implemented the range constraints, to be run.

@jaragunde
Copy link
Member Author

[Trac import]
Comment by: jaragunde
Original date: Wednesday, 12 August 2015 17:34

This is still happening in the following reports:

  • User tasks
  • Project evaluation

In the following management screens:

  • Users
  • Projects

And probably in XP tracker too.

@jaragunde
Copy link
Member Author

[Trac import]
Comment by: jaragunde
Original date: Wednesday, 12 August 2015 17:53

commit 2f234144834cb212048ba437e0a8d6722aa19129
Author: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Date:   Wed Aug 12 17:35:53 2015 +0200

    [#128] Fix date range constraints in user tasks and project evaluation reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant