Fix: field drag-and-drop reorder throws "Unknown field" RuntimeException#1166
Open
jbonor wants to merge 1 commit intopluginsGLPI:mainfrom
Open
Fix: field drag-and-drop reorder throws "Unknown field" RuntimeException#1166jbonor wants to merge 1 commit intopluginsGLPI:mainfrom
jbonor wants to merge 1 commit intopluginsGLPI:mainfrom
Conversation
Contributor
|
Several issues:
|
JS now reads data-ranking from table rows instead of using DOM indices, decoupling REDIPS row positions from backend ranking values. Migration normalizes rankings to contiguous 0-based values per container. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
806fa54 to
5202179
Compare
Author
|
Updated patch with a better approach that takes into consideration your issues I hope |
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.
fixes #1146
The REDIPS drag-and-drop library sends 1-based DOM row indices as
old_order/new_order, but reorder.php treated them as database ranking
values. When rankings have gaps (from deletions or prior reorders),
DOM indices diverge from stored rankings, causing the query
WHERE ranking = old_orderto find no matching field.Refactor reorder.php to accept positional indices: retrieve all fields
ordered by ranking ASC, map them to 1-based positions matching REDIPS
row indices, reorder via array manipulation, and persist with normalized
contiguous rankings. This also auto-repairs ranking gaps on every
reorder operation.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com