Skip to content

fix: Bulk update validation now reports correct error indices#715

Merged
binaryk merged 1 commit intoBinarCode:10.xfrom
george-todica:fix-bulk-update-preserve-validation-indices
Feb 12, 2026
Merged

fix: Bulk update validation now reports correct error indices#715
binaryk merged 1 commit intoBinarCode:10.xfrom
george-todica:fix-bulk-update-preserve-validation-indices

Conversation

@george-todica
Copy link
Copy Markdown
Contributor

Previously, bulk update validation always reported errors at index 0
regardless of which item failed. This was because validation happened
per-item inside the loop, with each item wrapped as [$plainPayload].

Changes:

  • Move allowToUpdateBulk() call before transaction (like bulk store)
  • Remove array wrapping in ValidatingTrait::validatorForUpdateBulk()
  • Add test for correct validation indices

Now when items at index 1 and 2 fail, errors correctly show as
1.field and 2.field instead of 0.field.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 12, 2026

@george-todica is attempting to deploy a commit to the BinarCode Team on Vercel.

A member of the Team first needs to authorize it.

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Feb 12, 2026

PR Summary

  • Improvements to Bulk Update Controller
    This change introduces a more efficient way to perform updates on multiple items in the database at once. Specifically, the logic behind bulk updates has been simplified by removing unnecessary checks, resulting in faster processing times.

  • Adjustments to Validation Logic
    The changes to the validation rules are designed to better handle situations where the data to be validated is not provided (null). The correct sequence now correctly identifies whether the data is present or not, improving overall system reliability.

  • Enhancement of Validation Tests
    The update includes additional tests to ensure the application behaves as expected when performing bulk updates. These tests confirm that the system correctly identifies indices, or positions of data items, within a bulk update, whether the update is valid or not. This helps to maintain the system's stability and accuracy.

@binaryk binaryk merged commit 72be19d into BinarCode:10.x Feb 12, 2026
10 of 11 checks passed
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.

2 participants