Client validation is not working for Title property of BlogPost (and other models) but OK for other properties (including other models)

Posted: August 16, 2019 at 11:38 AM Quote #244755
1. Version: 4.2
2. Expected: When Title input is empty I expect to see 'Title Required' message without full page reload using jquery validate
3. Actual: Page refreshes without triggering jquery validation
4. Steps: go to Admin -> Content -> New Blog Post -> Leave Title empty -> Save

When replacing <nop-editor... with <input asp-for="Title" the validation is working as expected then.

It seems to be something is wrong with nop-editor tag helper. Also the issue can be reproduced for Title property only. For other properties validation is triggered OK.

The issue is that data-val-required="" attribute is not in the result markup when using <nop-editor> for some reason
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: August 19, 2019 at 9:09 PM Quote #244876
Thanks, here is a work item for the further investigation of this issue.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx

Regards,
Maksim Romanov
Posted: September 05, 2019 at 6:30 AM Quote #245720
The data-val-* attributes are not created in the process of markup generation if ViewBug and Model have the same property name (in our case, Title). Therefore, the edit was to rename the Title property to ViewBug.

Please see this commit.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx

Regards,
Dmitriy Kulagin
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.