Blog Sections Open

Validating a Required TV Before Saving a Resource

If a TV must never be left empty, the save flow should stop before persistence and show the editor a clear message instead of silently accepting bad data.

Sometimes the safest protection in Evolution CMS is a simple one: stop a resource from being saved when a required TV field is empty. The tricky part is not the validation itself, but deciding where to intercept the save flow cleanly.

The real requirement

You are not trying to style the save button differently. You want the resource save to be blocked if a required TV has no value, and you want the editor to see a clear warning.

Recommendation

Handle this in a manager-side validation hook or save-time check rather than trying to fight the button markup directly. UI-level click interception is brittle; save-time validation is reliable.

Best practice

If the field is business-critical, validate it server-side every time. A message like “This field is required before saving” is much safer than trusting front-end behavior alone.

Newer post

Routing URLs Like /catalog/id Through OnPageNotFound

When a project needs cleaner product URLs without moving the data model into resources, an OnPageNotFound router can bridge the gap — as long as URL rewriting stays predictable.

Older post

Why tagLinks Can Fail on Latin Tags Even with UTF-8 Enabled

If Russian tags work and Latin tags fail, the issue is usually not raw encoding but how the tag parameter is normalized and matched in the request flow.