Skip to content

fix(manager): remove URI maxLength and show URI field on validation errors#16895

Open
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Ibochkarev:fix/13815-uri-too-long
Open

fix(manager): remove URI maxLength and show URI field on validation errors#16895
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Ibochkarev:fix/13815-uri-too-long

Conversation

@Ibochkarev
Copy link
Collaborator

What does it do?

  • Removes the maxLength: 255 constraint from the URI field in the resource panel and in the tree quick-create/quick-update form, so long URIs (e.g. with use_alias_path and nested resources) are no longer blocked by client-side validation.
  • When the server returns validation errors for the uri field, the panel now reveals the URI field and checks "Freeze URI" so the user sees which field failed.
  • When client-side validation fails (e.g. on the URI field), the same reveal logic runs before showing the errored tab.

Why is it needed?

With use_alias_path and nested resources, the generated URI can exceed 255 characters. The form showed a generic "Please correct the errors in your form before submitting." with no indication of the problematic field, because the URI field is hidden by default. Per maintainer feedback (opengeek): the uri column is TEXT and not limited to 191 characters; the index prefix is 191 but does not prevent longer values; there should not be a soft limit in the manager UI. Improving error handling was also requested (Mark-H).

How to test

  1. Enable friendly URLs and use_alias_path, with a deep resource tree and long aliases so the generated URI exceeds 255 characters.
  2. Edit a resource that would get such a long URI; save. Previously: generic error, no field highlighted. Now: URI field is revealed and the error is shown on it.
  3. Optionally trigger a server-side URI error (e.g. duplicate URI); confirm the URI field is revealed and the error is visible.

Related issue(s)/PR(s)

Resolves #13815

…rrors (modxcms#13815)

- Remove maxLength from URI field in resource panel and tree quick update
- Override failure to reveal URI field when server returns uri errors
- In failureSubmit, reveal URI field when client validation fails on uri
- Add revealUriField() and hasUriError() for clarity and reuse
@Ibochkarev Ibochkarev marked this pull request as ready for review February 25, 2026 03:04
@biz87
Copy link

biz87 commented Feb 25, 2026

Code Review

Summary

Removes client-side maxLength: 255 from the URI field (the uri column is TEXT, not limited to 255) and auto-reveals the hidden URI field when validation errors occur. +30/-3.

Assessment

Correct fix. hasUriError handles both array and object error formats. revealUriField is reused in two scenarios (client-side and server-side validation). The failure override correctly calls superclass.failure.

Verdict

Approve

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

Successfully merging this pull request may close these issues.

Fixed URI too long when using "use_alias_path".

2 participants