I used field validation to validate fields and node title validation to validate title in the content type
But it doesn't work with clientside_validation.
Also, how can I custom validate for content type in the D8.

Comments

trangunghoa created an issue. See original summary.

nikunjkotecha’s picture

Title: It doesn't work with field validation and node title validation module » Add support for field validation and node title validation modules
Version: 8.x-1.0-rc3 » 8.x-1.x-dev
Component: Field Validation » Code
Category: Bug report » Support request
Issue summary: View changes
nikunjkotecha’s picture

@trangunghoa possible to give a scenario for the custom validation you are talking about here?

Also, since this is another contrib module we are talking about here, it doesn't really qualify as bug :)

jelle_s’s picture

In 8.x we made a choice to switch to validation plugins. In 7.x we added support upon support for contrib modules, which made the module very bloated.

I remember that we had a submodule to support field validation because it needed custom implementation. I personally would recommend filing a feature request for the field_validation module for them to add the Clientside Validation plugins, or to start a contrib module that does the implementation. (I've said the same about the webform module too.

As for the custom validation, it's the same principle. You need to implement a plugin that supports the element that needs the validation and add the validation to that element. You can take a look at the existing plugins in the core module to give you an idea of how it works.

On a side note: I'm speaking for myself here, if @attiks or @nikunjkotecha disagrees with me, feel free to discard this comment.

nikunjkotecha’s picture

@Jelle_S completely agree with you here. Just wanted to check once before saying no as in one of the other bugs related to webform it seems clientside validation gets applied on wrong field. I just wanted to confirm it is not breaking other module, if it simply doesn't add the validation - no change required. Also, I really need to spend time once with 7.x code, I'm being lazy to avoid that as much as I can to focus on getting stable version released for 8.x.

jelle_s’s picture

Yeah, I started the 7.x-2.x branch with the same mindset as the 8.x branch (it was actually created before we started 8.x development). I never dared to publish it as the recommended version as this is a pretty well used module and I wasn't sure what it mightbreak (if anything at all). But it is, in my opinion, cleaner and more maintainable code. It still contains support for all modules supported in 7.x-1.x if I recall correctly, but it was a first step towards ripping them out of the core module and turning them in to separate contrib modules.

nikunjkotecha’s picture

Status: Active » Postponed (maintainer needs more info)