phppgadmin/phppgadmin — pull request #8 by kleinjakob (2012-08-31 02:19:18+00:00)
Title: Quick fixed leakage of formatting tags from autocomplete into target field.

Added a param to printVal in Misc, named 'autocomplete', which will prohibit the alignment of numbers if set (thus keeping `

` tags from showing up). Modified the `ajax-ac-insert.php` to set the `autocomplete` param to true (not needed - actually only checks if this parameter exists) when using `$misc->printVal`.

The problem was if there was a FK consisting of multiple fields, the formatting of these fields was copied along in the autocomplete (for example in a integer field as part of a mutifield FK), resulting in invalid data in the FK field (like `

2

` ending up in the field instead of just `2`)

This is a very dirty hack - better would be to keep the formatting in the table returned by `ajax-ac-insert.php` as is - but make the JavaScript which is coping the data strip the formatting tags before inserting into the FK field. I couldn't find were the code is that does this, so this is a quick hack that works for me and i wanted to share it (formatting of non-numerical types will still cause the same problems, but one can copy the code there).

Kind regards,
Jakob