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

dev/core#2846 Towards validation of start and end dates. Forms. #21513

Conversation

JKingsnorth
Copy link
Contributor

@JKingsnorth JKingsnorth commented Sep 17, 2021

Please see https://lab.civicrm.org/dev/core/-/issues/2846#note_65250

First step towards improving validation of entities with 'start' and 'end' dates, ensuring they are consistent. And applying consistent checking location. First step is applying form-level validation.

@civibot
Copy link

civibot bot commented Sep 17, 2021

(Standard links)

@civibot civibot bot added the master label Sep 17, 2021
@JKingsnorth
Copy link
Contributor Author

JKingsnorth commented Sep 17, 2021

Test failures are related; and I think I should be adding extra tests to the affected forms to cover the validation.

It would be good to get a 'concept approved' on this via https://lab.civicrm.org/dev/core/-/issues/2846 before I proceed though.

@JKingsnorth JKingsnorth force-pushed the core-2846-1-improve-start-end-date-validation branch from a726c90 to 4347c49 Compare September 20, 2021 21:32
@JKingsnorth
Copy link
Contributor Author

JKingsnorth commented Sep 21, 2021

Tests added, this is ready for review. @eileenmcnaughton , I know how much you like PRs that add tests. (And I'm very happy to take feedback on the approaches used, if you think I can improve =] )

@eileenmcnaughton
Copy link
Contributor

Nice - I've given it the all-important pink label so that will stay on my view of the PR queue

@BettyDolfing
Copy link

test this please

@JKingsnorth
Copy link
Contributor Author

Jenkins test this please

@jaapjansma
Copy link
Contributor

@BettyDolfing and I are reviewing PR's and we tried to reproduce the issue. And we found that the issues where too different from each other so we suggested to create separate issues for each specific use case, and separate PR's for them. See https://lab.civicrm.org/dev/core/-/issues/2846#note_68143

@JKingsnorth are you still willing to work on this issue?

On a side note we also saw a lot of warnings in the test environment of this PR. See screenshot below.
Screenshot_20211215_103955

@JKingsnorth
Copy link
Contributor Author

@jaapjansma / @BettyDolfing Thanks for taking a look.

I agree that trying to tackle the form, APIs, BAO layers should all be done in separate PRs.

But this PR I think is a 'complete' solution for improving validation and error messages in the form layer, ie: when using the front end form features.

This PR does not aim to resolve it in all places, and the actual code is fairly minimal (a lot of the lines changes are due to tests which have been added).

I do not think those warnings are related to this merge request, because I do not touch the .hlp.php files in this merge request.

So I still think this PR is ready, and is a first step towards https://lab.civicrm.org/dev/core/-/issues/2846

@BettyDolfing
Copy link

Test this please

@jaapjansma
Copy link
Contributor

@JKingsnorth thanks for your response. @BettyDolfing and I are not able to review this PR as we don't feel comfortable in testing it because we think this PR tries to solve too many different issues (although they are related). Maybe someone else is able to review this.

@mattwire
Copy link
Contributor

mattwire commented Mar 9, 2022

@JKingsnorth needs rebase

@eileenmcnaughton
Copy link
Contributor

@JKingsnorth I'm sorry I've only just looked at this - I agree it improves the date validation - making it impossible to have the start date before the end date in more places & requiring date be set if time is - and the tests are yay yay yay

image

@eileenmcnaughton eileenmcnaughton merged commit c71d455 into civicrm:master Apr 27, 2022
@JKingsnorth
Copy link
Contributor Author

Thanks very much for taking the time to look at this @eileenmcnaughton !

@eileenmcnaughton
Copy link
Contributor

@JKingsnorth it's a good change

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

Successfully merging this pull request may close these issues.

5 participants