Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 500 if format is not passed to the create custom field endpoint payload #12131

Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Nov 16, 2022

Previously, if you did not include format in your new custom field API call, the call would fail with a 500 error that looks like this:

"message": "Undefined index: format",
    "exception": "ErrorException",
    "file": "/Users/snipe/Sites/snipe-it/snipe-it/app/Http/Controllers/Api/CustomFieldsController.php",
    "line": 99,

This fix corrects that behavior and checks to see that the format index actually exists in the $data payload.

… custom field via API

Signed-off-by: snipe <snipe@snipe.net>
@what-the-diff
Copy link

what-the-diff bot commented Nov 16, 2022

  • Added a check to see if the format key exists in $data
  • If it does, then we will continue with our regex logic

@snipe snipe merged commit 4ffe13d into develop Nov 16, 2022
@snipe snipe deleted the fixes/check_for_format_index_in_custom_field_api_call branch November 16, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant