Dear Support
Recently Minesh kindly provided us with code (Toolset Settings > Custom Code > func-validate-nanny-ad-approximate-location). See also ticket
https://toolset.com/forums/topic/prevent-toolset-forms-allowing-saving-of-non-german-addresses-with-toolset-maps/page/3/#post-2521441
The code should validate the address entered in the form on a Nanny Ad, to ensure it is an address within Germany.
I tried duplicating the code for Job Ads (func-validate-job-ad-dev-approximate-location), but now when I try to save a Job Ad, it complains about an array from the Nanny Ad code:
Warning: Undefined array key "wpcf-nanny-approximate-location" in /var/www/web24632223/html/dev/wp-content/toolset-customizations/function-validate-nanny-ad-dev-approximate-location.php on line 39
Likewise if I try to save a Nanny Ad, it complains about an array from the Job Ad code:
Warning: Undefined array key "wpcf-family-approximate-location" in
/var/www/web24632223/html/dev/wp-content/toolset-customizations/func-validate-job-ad-dev-approximate-location.php on line 39
To try to solve this error, I prefixed all the variables from the Job Ad version with "jobAd" so they would be different from the variables stored in the Nanny Ad version, so for example, $slug became $jobAdSlug etc, but that didn't solve the issue.
Furthermore,
Post Form - New Nanny Ad (ID: 921) and
Post Form - New Job Ad (ID: 929)
also had code entered in the JS Editor of the forms, which prevented Google from suggesting addresses outside of germany in the first place. This no longer seems to be working, and I was wondering if the new code has somehow broken this JS code too.
To reproduce the error, just enter a city not located in Germany, eg "Paris" or "London" and don't choose anything from the Google AutoComplete suggestions.
Thanks and kind regards
Simon