Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwriting bookmarked query causes PHP Fatal error #16104

Closed
TheWatcher opened this issue May 2, 2020 · 1 comment
Closed

Overwriting bookmarked query causes PHP Fatal error #16104

TheWatcher opened this issue May 2, 2020 · 1 comment
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@TheWatcher
Copy link

TheWatcher commented May 2, 2020

Describe the bug

When "Replace existing bookmark of same name" is selected when running a SQL query, the query fails with an "Error in processing request" popup. When looking in the server logs, I have the error:

PHP Fatal error:  Uncaught TypeError: Argument 5 passed to PhpMyAdmin\\Sql::storeTheQueryAsBookmark() must be of the type bool or null, string given, 
called in [path removed]/phpMyAdmin-5.0.2-english/import.php on line 772 and defined in [path 
removed]/phpMyAdmin-5.0.2-english/libraries/classes/Sql.php:903\nStack trace:\n#0 [path removed]/phpMyAdmin-5.0.2-english/import.php(772): PhpMyAdmin\\Sql-
>storeTheQueryAsBookmark('aviary', 'chris', 'SELECT * FROM `...', 'testing1', 'true')\n#1 {main} 
thrown in [path removed]/phpMyAdmin-5.0.2-english/libraries/classes/Sql.php on line 903

To Reproduce

Steps to reproduce the behavior:

  1. Go to the SQL tab for a table in a database
  2. Enter a query
  3. Enter the name of a previously bookmarked query in the "Bookmark this SQL query:" box
  4. Tick the "Replace existing bookmark of same name"
  5. Click "Go"
  6. 500 "Error in processing request" popup appears and the above error is logged

Expected behavior

Query run, and bookmarked SQL query updated.

Server configuration

  • Operating system: Gentoo Linux
  • Web server: Apache
  • Database version: 8.0.19-r1
  • PHP version: 7.4.5
  • phpMyAdmin version: 5.0.2

Client configuration

  • Browser: Chrome 81.0.4044.129 (Official Build) (64-bit)
  • Operating system: Windows 10

Additional context

I have fixed this on my install with the attached patch
import.txt

@williamdes williamdes added the Bug A problem or regression with an existing feature label May 2, 2020
@williamdes williamdes added this to the 5.0.3 milestone May 2, 2020
@williamdes williamdes added this to Needs triage in issues via automation May 2, 2020
@williamdes williamdes moved this from Needs triage to to be fixed soon in issues May 2, 2020
@williamdes williamdes self-assigned this May 2, 2020
williamdes added a commit that referenced this issue May 2, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from to be fixed soon to Closed May 2, 2020
@williamdes
Copy link
Member

Thank you for reporting this issue @TheWatcher !
It will be fixed in next 5.0 version and you can apply the patch (a06c62e) locally to fix it before the new version is out

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature
Projects
issues
  
Closed
Development

No branches or pull requests

2 participants