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

"Could not save field." #26

Closed
havardlj opened this issue Apr 25, 2019 · 4 comments
Closed

"Could not save field." #26

havardlj opened this issue Apr 25, 2019 · 4 comments

Comments

@havardlj
Copy link

Getting "Could not save field." without any error message under any inputs when creating/editing existing calendarize-fields after latest plugin update. Can't find anything in the error logs either.

@fvaldes33
Copy link
Contributor

@havardlj - it should not be failing silently. The new custom validator only fires on three specific cases.

  • If there is a start date there must also be an end date
  • If there is a start date it must not be less than the start date
  • If the event repeats and repeat ends on a specific date, the End On Date field must be filled

You can take a look here CalendarizeValidator.php

Could you share what your calendarize field looks like?

@havardlj
Copy link
Author

It fails before getting to any of those steps
https://imgur.com/a/PseBmZ6

@robbeman
Copy link

I ran into this as well. This is the place where it fails: https://github.com/craftcms/cms/blob/master/src/services/Fields.php#L755

When I commented the return false; as an experiment to see if anything breaks the field is saved and seems to work fine.

I do not know much about these validators and I can't seem to figure out which specific validator fails, but maybe it helps to know it's the validator anyway.

@fvaldes33
Copy link
Contributor

Just pushed a fix for this. The validation rules were in the incorrect place. I am currently working on adding better unit testing to this plugin to avoid these issues in the future.

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

No branches or pull requests

3 participants