Duplicate address error

From TNG_Wiki
Jump to navigation Jump to search

Issue found in v11.1. Not known if the recommended fix works on earlier versions.

When editing an address to make it complete, TNG crashed with an error, when I tried to save the record:

"An error has occurred in the TNG software. This could be due to a setup issue, an incomplete upgrade or a program bug. If you are the site owner, you may contact TNG support for help with this problem. Please copy the query below and paste it into your message.

Query: UPDATE tng_places SET place="Milton Keynes, Buckinghamshire, England",placelevel="3",temple="0",latitude="52.0406224",longitude="-0.7594171000000642",zoom="10",notes="",geoignore="0" WHERE ID="2905"

Duplicate entry 'Tree01-Milton Keynes, Buckinghamshire, England' for key 'place' "''

I reported it to Darrin and he came back with this:

"The fix is simple: just change line 43 of admin_updateplace.php from "tng_query" to "tng_query_noerror", like this:

$result = @tng_query_noerror($query);

That fixes it. You now get an elegant in-app error