panel icon indicating copy to clipboard operation
panel copied to clipboard

Fix: External identifier validation error handling

Open KroZen-Dev opened this issue 10 months ago • 3 comments

This pull request introduces stricter validation to ensure that the external_id field for servers remains unique when updating server details, and adds a utility method for update validation rules. The changes enhance data integrity and provide clearer error handling for duplicate external IDs.

Validation Improvements:

  • Added a uniqueness check for external_id in the ServersController update logic, throwing a ValidationException if a duplicate is found when updating a server.
  • Added a similar uniqueness validation for external_id in ServerFormRequest, ensuring that form requests also enforce this rule and provide user-friendly error messages.

Model Enhancements:

  • Introduced a new static method getRulesForUpdate in the Server model to generate validation rules suitable for update operations, handling uniqueness checks and allowing for the exclusion of the current record.
  • Imported the Rule class in Server.php to support advanced validation rule definitions.

🔗 Linked Issue:

#5549

KroZen-Dev avatar Feb 04 '26 21:02 KroZen-Dev

@KroZen-Dev instead of saying The external identifier must be unique to this server. shouldn't it say it has to be unique on the panel? its not possible to assign more than 1 to a individual server

AndyIsHereBoi avatar Feb 04 '26 21:02 AndyIsHereBoi

@KroZen-Dev instead of saying The external identifier must be unique to this server. shouldn't it say it has to be unique on the panel? its not possible to assign more than 1 to a individual server

Agreed, corrected

KroZen-Dev avatar Feb 05 '26 06:02 KroZen-Dev

this should be closed @robertdrakedennis

lajczi avatar Jun 23 '26 08:06 lajczi