Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"Choose column to display" does not work #13533
Steps to reproduce
The column to display should change.
Firstly, the dropdown started with a field selected that I don't remember selecting in the first place, and didn't want. So I tried to change it to something useful. Clicking save appears to do something (it pops up the "Loading" banner) but it doesn't change the field. If I click "Preview SQL" it always says "No change".
If I'm not mistaken the preferences should be stored in the table
Operating system: Mac
Web server: Apache
Database: Mysql 5.6.13
PHP version: 5.5.38
phpMyAdmin version: 4.7.3
Operating system: Mac
I can confirm it happens on 4.7.3 with other browsers on Mac as well (Firefox 54 and Safari 10). PHP version is 5.6.31, MySQL server 5.5.57, libmysqlclient 5.1.73
How to best fix this is left up to your imagination. My quick hack was to do an "insert...on duplicate key" sql instead of an "update":
I disclaim all right to the above code. anybody can use it for any reason.
The problem is caused by this code:
If there is no "display_field" set for this table it defaults to the first character field.
public function updateDisplayField($disp, $display_field, $cfgRelation)
It compares $disp (which can be the defaulted value) with your changed value (whatever you set). Since those two do not match...it does an UPDATE instead of an INSERT.
And an update to a non-existent key "works" but does nothing since there is no record to overwrite....so thats why there is no sql error but the display field wasn't being updated.
anyway. that's all the patience I have for this issue, someone else can do a PR.
added a commit
Sep 4, 2017
The issue with selecting the 'column to display' is fixed, but I'm wondering where does PMA get said column from when displaying the dropdown in Relation View? It seems like it should come from
But I cleared out that table and it still shows a particular column selected on that dropdown. Does that selection come from somewhere other than