After upgrade to 7.0, SQL Escaping ERROR with additional_addresses / Invalid JSON response

In a test instance of OpenEMR 7.0, upgraded from 6.1, when searching on a patient in the top right search box; or when I subsequently search for a patient in Patient Finder using the “Search:” box in the top right of that page’s dialog and then click on a patient name, I get the following error:

“DataTables warning: table id=pt_table - Invalid JSON response. For more information about this error, please see

From the log:
ERROR: OpenEMR SQL Escaping ERROR of the following string: additional_addresses, referer: interface/main/finder/dynamic_finder.php?search_any=test

If I were instead to seach another way using Patient Finder then I don’t see the error. And I only see it in the above 2 instances; once the error is dispelled, subsequent searches dont elecit the error.

External ID / pubpid is hidden in the demographics form. If I instead make it Optional then I also get this error:
URL: undefined
Line: undefined Column: undefined
Error object: undefined”

I’ve seen this previously with OpenEMR 6.1 when I first hid “External ID” in the demographics form. Back then I learned this: “A forum thread tells me to expect this error message when disabling elements of the demographics form. I’ve instead hidden, not disabled, the element, which is the correct approach and one that’s not supposed to result in this error.” That issue appeared to eventually go away.

I’m aware that at least the “Invalid JSON response” is an issue in the data being sent out to the browser, rather than an actual db issue.

Any ideas please?

@psoas fixed this in Dynamic Finder AJAX Fix (#5629) · openemr/openemr@e854a3d · GitHub, will be in 1st patch

Great, fixed with that patch. Many thanks.