Repository navigation
fix: reject duplicate FieldID on add-new-field instead of silently overwriting - #127
Merged
Merged
Conversation
…message Agent-Logs-Url: https://github.com/rsyslog/loganalyzer/sessions/7426319d-2219-46e5-8029-85e39f1f0db2 Co-authored-by: alorbach <1675286+alorbach@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
alorbach
May 6, 2026 11:14
View session
alorbach
marked this pull request as ready for review
May 6, 2026 11:14
Member
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The add-field POST handler in
admin/fields.phpused a single INSERT-or-UPDATE code path regardless of whether the request came from the "add new field" or "edit field" form. Submitting a new field with an existing FieldID silently overwrote the existing record.Changes
src/admin/fields.php— Before INSERT/UPDATE, check$_POST['op']. Whenop=addnewfieldand the FieldID already exists in the DB, set an error and abort instead of falling through toUPDATE. Theeditfieldpath is unchanged.src/lang/{en,de,es,ja}/admin.php— AddLN_FIELDS_ERROR_FIELDIDEXISTS: "A field with the FieldID '%1' already exists. Use the edit function to modify an existing field."Summary by cubic
Reject duplicate FieldID when adding a new field to prevent silent overwrites and provide a clear, localized error message.
src/admin/fields.php, whenop=addnewfieldand theFieldIDexists, return an error and do not update; edit flow is unchanged.LN_FIELDS_ERROR_FIELDIDEXISTStosrc/lang/{en,de,es,ja}/admin.phpfor consistent messaging.Written for commit 1ac0570. Summary will update on new commits.