Skip to content

Fix #17713 - Show clear error when SQL setup files are missing#20293

Open
predictor2718 wants to merge 1 commit into
phpmyadmin:QA_5_2from
predictor2718:fix/17713-sql-files-missing-error
Open

Fix #17713 - Show clear error when SQL setup files are missing#20293
predictor2718 wants to merge 1 commit into
phpmyadmin:QA_5_2from
predictor2718:fix/17713-sql-files-missing-error

Conversation

@predictor2718

@predictor2718 predictor2718 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Closes #17713.

When the user removes the sql/ directory (per FAQ 1.44 to reduce installed
size on disk) and then clicks "Create" on the configuration-storage prompt,
Relation::getDefaultPmaTableNames() returns an empty array (file_get_contents
fails). Relation::fixPmaTables() then accessed $createQueries[$table] which
was undefined, ending up with tryQuery(null, ...)TypeError, HTTP 500.

This patch:

  • Suppresses the file_get_contents warning when the SQL file is missing (the
    sql/ directory is intentionally removable per FAQ).
  • Detects the empty-result case in fixPmaTables() and sets a clear message
    pointing the user at the missing directory, instead of crashing.

Before / after with the sql/ directory removed:

issue17713-before issue17713-after

A parallel PR for master/6.0-dev will follow (same fix, different file paths).

Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
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