Minor issue - query builder not updating after field changes

Sometimes field names are not updated following database field name changes - even when they’re re-selected. This has happened to me several times and caused queries to fail.

In this example, I decided to change the field name from exportformat_id to exf_id. I re-saved the connection - and Wappler correctly refleced the changes. I then re-selected the field names. In most cases everything is updated correctly, but as you can see here, the field used in the condition is not the same as the one appearing in the SQL preview - and running the query results in a 500 error due to the non-existent (old) field:

It’s easy to fix - re-re-selecting usually fixes it - but it could cause some confusion. When it happens, I think it’s usually in the WHERE clause.

Have you tried unlinking and then re-linking the query This often clears issues like this where the query and the linked query get out of sync

Yes, that’s what I do. Sometimes it takes a little persuasion but it can always be resolved.

As I say it’s not a big problem, but it’s the sort of thing that could cause a lot of head-scratching.

I have got into the habit of unlink/link as part of my save process now for exactly that reason, wasted hours due to this issue in the early days

I think it’s been a problem - perhaps always. It would be good if it were fixed.

In case it’s useful to have another example, here is a case where I couldn’t get the correct condition to update despite reselecting several times. The only way was to edit the Server Connect php file directly.

I have two pages which are very similar; they include a list of letters, each of which performs a query and displays the results in a list. The main difference is that the pages query different tables. The required action files are also therefore very similar. Rather than start from scratch, I duplicated the Server Connect file and the corresponding App Connect file and made the necessary changes. However it didn’t work - due to an error with an unknown column.

Query builder showed the correct column name:

image

… but the action file included the name from the previous file (the file I had copied):

… so of course the query failed. This column name appears 4 times in the php file; in 2 cases is was correctly updated, in 2 cases it wasn’t. It was easy to debug and easy to edit the file, but this does seem to be a bug which could cause problems.