Fix #19998 stale grid edit state after AJAX table refresh #20021
+27
−0
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.
Description
This pull request fixes a client-side issue where inline-edit errors reappear after refreshing a table via AJAX.
Root cause:
When an inline grid edit fails (e.g. invalid JSON), the grid editing controller created by makeGrid() keeps edit-session state (active cell, last XHR, edit flags). Since the “Refresh” action reloads the table via AJAX rather than a full page reload, this state persists and causes the previous error to be re-triggered on subsequent interactions.
Solution:
Expose a small reset method on the grid instance created by makeGrid().
Associate the grid instance with its table element using jQuery .data().
During AJAX teardown in change.js, retrieve the grid instance and reset its edit-related state, ensuring refreshed tables start with a clean client-side state.
This keeps responsibilities properly scoped to the owning modules and aligns with phpMyAdmin’s AJAX lifecycle.
Fixes #19998
Before submitting pull request, please review the following checklist:
Signed-off-byline as described in our DCO. This ensures that the work you're submitting is your own creation.Video proof after solving the bug:
Screencast from 2026-01-12 11-43-17.webm