Skip to content

Conversation

@og-khushalpatel
Copy link

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:

  • Make sure you have read our CONTRIBUTING.md document.
  • Make sure you are making a pull request against the correct branch. For example, for bug fixes in a released version use the corresponding QA branch and for new features use the master branch. If you have a doubt, you can ask as a comment in the bug report or on the mailing list.
  • Every commit has proper Signed-off-by line as described in our DCO. This ensures that the work you're submitting is your own creation.
  • Every commit has a descriptive commit message.
  • Every commit is needed on its own, if you have just minor fixes to previous commits, you can squash them.
  • Any new functionality is covered by tests.

Video proof after solving the bug:
Screencast from 2026-01-12 11-43-17.webm

Signed-off-by: Khushal Patel <khushal.b.patel01@gmail.com>
Signed-off-by: Khushal Patel <khushal.b.patel01@gmail.com>
@og-khushalpatel og-khushalpatel force-pushed the fix/remembered-bad-query branch from 6d12818 to 7370361 Compare January 12, 2026 15:21
Signed-off-by: Khushal Patel <khushal.b.patel01@gmail.com>
@og-khushalpatel og-khushalpatel force-pushed the fix/remembered-bad-query branch from 7370361 to d64bad4 Compare January 13, 2026 11:58
@og-khushalpatel og-khushalpatel changed the title Fix stale grid edit state after AJAX table refresh Fix #19998 stale grid edit state after AJAX table refresh Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant