Skip to content

[stable1.0] fix: add validation for columnDto - #2715

Merged
enjeck merged 2 commits into
stable1.0from
backport/2414/stable1.0
Aug 29, 2026
Merged

[stable1.0] fix: add validation for columnDto#2715
enjeck merged 2 commits into
stable1.0from
backport/2414/stable1.0

Conversation

@backportbot

@backportbot backportbot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Backport of PR #2414

@backportbot
backportbot Bot requested review from blizzz and enjeck as code owners June 10, 2026 13:50
@backportbot
backportbot Bot requested a review from samin-z June 10, 2026 13:50
@backportbot backportbot Bot added the 3. to review Waiting for reviews label Jun 10, 2026
@enjeck
enjeck force-pushed the backport/2414/stable1.0 branch 2 times, most recently from 81dbfd3 to 992e612 Compare June 16, 2026 06:23

@enjeck enjeck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, tables-import-export-scheme is failing.
This needs to be fixed in main too (#2414), i think?

Comment thread lib/Validation/ColumnDtoValidator.php Outdated
Comment on lines +19 to +20
if ($textMaxLength !== null && $textMaxLength < 0) {
throw new BadRequestError('Maximum text length must be greater than or equal to 0.');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 is the sentinel value for "no maximum length" (e.g. existing/imported schemes), so only values below -1 are invalid.

Suggested change
if ($textMaxLength !== null && $textMaxLength < 0) {
throw new BadRequestError('Maximum text length must be greater than or equal to 0.');
if ($textMaxLength !== null && $textMaxLength < -1) {
throw new BadRequestError('Maximum text length must be greater than or equal to 0.');

Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
@enjeck
enjeck force-pushed the backport/2414/stable1.0 branch from 992e612 to 78a93cb Compare August 29, 2026 07:06
@enjeck
enjeck merged commit 1cd0b5a into stable1.0 Aug 29, 2026
65 checks passed
@enjeck
enjeck deleted the backport/2414/stable1.0 branch August 29, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants