Location custom field by AddonsLab

Location custom field by AddonsLab [Paid] 2.0.7

No permission to buy ($39.99)
PHP:
    protected function _preSave()
    {
        parent::_preSave();

        if ($this->field_type !== 'location') {
            $this->location_options = [];
        }
    }
 
AddonsLab updated Location custom field by AddonsLab with a new update entry:

Multilingual support for Google Autocomplete

Multilingual support for Google Autocomplete

Added multilingual search capability by applying the default country scope to the search query. This ensures that language-specific characters are supported in the search form, making locations with such characters properly searchable.

Improved handling of partial Google Place API responses

When the Location field sends a partial or invalid query to the Google Place API, or when the detected location is too generic, the system now...

Read the rest of this update entry...
 
When trying to update from 2.0.3 to 2.0.5 on my staging server:
Code:
XF\PrintableException: Batch install error: Line 35: The function get_entity_name may not be called in a template.
Only functions with whitelisted prefixes are allowed. - Template name: admin:allf_area_list - src/XF/Mvc/Entity/Entity.php:1276

Stack Trace

#0 src/XF/AddOn/DataType/Template.php(98): XF\Mvc\Entity\Entity->save(true, false)
#1 src/XF/Job/AddOnData.php(111): XF\AddOn\DataType\Template->importAddOnData('AL/LocationFiel...', Object(SimpleXMLElement), 0, 7.99841)
#2 src/XF/Job/AddOnInstallBatch.php(343): XF\Job\AddOnData->run(7.99841)
#3 src/XF/Job/AddOnInstallBatch.php(99): XF\Job\AddOnInstallBatch->stepData(Object(XF\Timer))
#4 src/XF/Job/Manager.php(275): XF\Job\AddOnInstallBatch->run(8)
#5 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#6 src/XF/Job/Manager.php(121): XF\Job\Manager->runJobEntry(Array, 8)
#7 src/XF/Admin/Controller/ToolsController.php(146): XF\Job\Manager->runByIds(Array, 8)
#8 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(Wutime\AdBlockTracker\XF\Admin\Controller\Tools), NULL)
#10 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Wutime\AdBlockTracker\XF\Admin\Controller\Tools), NULL)
#11 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#13 src/XF.php(806): XF\App->run()
#14 admin.php(15): XF::runApp('XF\\Admin\\App')
#15 {main}
 
I told you about the problem yesterday, so thank you for your quick response.
However, I don’t understand this sentence:

When the Location field sends a partial or invalid query to the Google Place API, or when the detected location is too generic, the system now returns the error: “Address is not precise enough.”

You have solved it, so we will not see this message anymore?
Could you explain briefly what happened before?

About four weeks ago, Google seems to have changed something, and since then the system has often shown “Address is not precise enough” when using original Google addresses.

I have to write "Loewe" instead "Löwe" to make Google work.
 
When trying to update from 2.0.3 to 2.0.5 on my staging server:
Code:
XF\PrintableException: Batch install error: Line 35: The function get_entity_name may not be called in a template.
Only functions with whitelisted prefixes are allowed. - Template name: admin:allf_area_list - src/XF/Mvc/Entity/Entity.php:1276

Stack Trace

#0 src/XF/AddOn/DataType/Template.php(98): XF\Mvc\Entity\Entity->save(true, false)
#1 src/XF/Job/AddOnData.php(111): XF\AddOn\DataType\Template->importAddOnData('AL/LocationFiel...', Object(SimpleXMLElement), 0, 7.99841)
#2 src/XF/Job/AddOnInstallBatch.php(343): XF\Job\AddOnData->run(7.99841)
#3 src/XF/Job/AddOnInstallBatch.php(99): XF\Job\AddOnInstallBatch->stepData(Object(XF\Timer))
#4 src/XF/Job/Manager.php(275): XF\Job\AddOnInstallBatch->run(8)
#5 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#6 src/XF/Job/Manager.php(121): XF\Job\Manager->runJobEntry(Array, 8)
#7 src/XF/Admin/Controller/ToolsController.php(146): XF\Job\Manager->runByIds(Array, 8)
#8 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(Wutime\AdBlockTracker\XF\Admin\Controller\Tools), NULL)
#10 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Wutime\AdBlockTracker\XF\Admin\Controller\Tools), NULL)
#11 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#13 src/XF.php(806): XF\App->run()
#14 admin.php(15): XF::runApp('XF\\Admin\\App')
#15 {main}

This is related to a bug we have reported at https://xenforo.com/community/threads/breaking-change-in-xenforo-2-3-7-in-getter-syntax.232161/ We will release a patch in several hours and the bug fix is going to be released with 2.3.8
When the Location field sends a partial or invalid query to the Google Place API, or when the detected location is too generic, the system now returns the error: “Address is not precise enough.”
We have reproduced this issue with our automated tests, so there is no specific use case reported by customers, but Google changed how it replies in the case when a non-existing street is requested for a country. Now we handle it better, so invalid addresses should reported as non-exising, instead of converting into a country (using address approximation),

This fix is not related to the language issue. Language fix was only via putting additional configuration in JS API just informing Google what is the expected locale based on default country. Please check and let us know if this is working for you,

Thank you!
 
AddonsLab updated Location custom field by AddonsLab with a new update entry:

XenForo 2.3.7 issue patch release

A new method - getEntityNameLowerCase has been added to address the template error - get_entity_name not available.

This issue is related to a XenForo bug reported at https://xenforo.com/community/threads/breaking-change-in-xenforo-2-3-7-in-getter-syntax.232161/ that will be resolved in version 2.3.8.

Meanwhile, please apply this package and install the latest version of the affected add-on to resolve the error.

Read the rest of this update entry...
 
I get the following error every time I attempt to enter a value for the Google Places API Key.

"[E_WARNING] Undefined array key 0"
 
I am having difficulties to get this addon to work, I am not using the Google APIs and instead I'm using the country/area/city lists. I have experienced three problems:

1. When the country/area/city are configured to obtain the lists from the database, I cannot press the "edit" button which expands the UI to edit a post, the console shows an error:
Code:
location-form-xf23.js?_v=7730ce9d:141 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'cloneNode')
    at b.initLocationForm (location-form-xf23.js?_v=7730ce9d:141:87)
    at b.init (location-form-xf23.js?_v=7730ce9d:96:22)
    at c (core-compiled.js?_v=7730ce9d:193:444)
    at b (core-compiled.js?_v=7730ce9d:194:141)
    at NodeList.forEach (<anonymous>)
    at Object.initialize (core-compiled.js?_v=7730ce9d:195:205)
    at Object.activate (core-compiled.js?_v=7730ce9d:44:468)
    at message.min.js?_v=7730ce9d:5:189
    at core-compiled.js?_v=7730ce9d:50:53
    at core-compiled.js?_v=7730ce9d:107:26
initLocationForm @ location-form-xf23.js?_v=7730ce9d:141
init @ location-form-xf23.js?_v=7730ce9d:96
c @ core-compiled.js?_v=7730ce9d:193
b @ core-compiled.js?_v=7730ce9d:194
initialize @ core-compiled.js?_v=7730ce9d:195
activate @ core-compiled.js?_v=7730ce9d:44
(anonymous) @ message.min.js?_v=7730ce9d:5
(anonymous) @ core-compiled.js?_v=7730ce9d:50
(anonymous) @ core-compiled.js?_v=7730ce9d:107
Promise.then
b @ core-compiled.js?_v=7730ce9d:106
setupHtmlInsert @ core-compiled.js?_v=7730ce9d:48
handleAjax @ message.min.js?_v=7730ce9d:5
l @ core-compiled.js?_v=7730ce9d:38
ajax @ core-compiled.js?_v=7730ce9d:41
await in ajax
click @ message.min.js?_v=7730ce9d:4
_onEvent @ core-compiled.js?_v=7730ce9d:190
a @ core-compiled.js?_v=7730ce9d:188
(anonymous) @ core-compiled.js?_v=7730ce9d:192

2. If I go to the edit URL directly, the addon mostly works and the dropdowns are updated according to the selected country/region. However, there are some countries that returns an error. I haven't made an exhaustive investigation but it fails if I select "Cocos Islands":
Code:
ErrorException: [E_WARNING] Undefined array key 0 in src/addons/AL/LocationField/Service/Data.php at line 110
[LIST=1]
[*]XF::handlePhpError() in src/addons/AL/LocationField/Service/Data.php at line 110
[*]AL\LocationField\Service\Data->getAvailableCityList() in src/addons/AL/LocationField/XF/Pub/Controller/Misc.php at line 37
[*]AL\LocationField\XF\Pub\Controller\Misc->actionLocationFieldLoadList() in src/XF/Mvc/Dispatcher.php at line 362
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
[*]XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2824
[*]XF\App->run() in src/XF.php at line 806
[*]XF::runApp() in index.php at line 23
[/LIST]


3. But for my particular use case, I do not need to select a country so I configure it to be read only and configured to my particular country. With this configuration, the drop downs are not updated at all so the State/Area dropdown is displayed correctly but the City dropdown is fixed at the cities from the first state in the list and doesn't get udpated when you select new states. This same behavior happens in the filter dropdown in the thread list page.


Any idea how to fix it?
 
Last edited:
I am having difficulties to get this addon to work, I am not using the Google APIs and instead I'm using the country/area/city lists. I have experienced three problems:

1. When the country/area/city are configured to obtain the lists from the database, I cannot press the "edit" button which expands the UI to edit a post, the console shows an error:
Code:
location-form-xf23.js?_v=7730ce9d:141 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'cloneNode')
    at b.initLocationForm (location-form-xf23.js?_v=7730ce9d:141:87)
    at b.init (location-form-xf23.js?_v=7730ce9d:96:22)
    at c (core-compiled.js?_v=7730ce9d:193:444)
    at b (core-compiled.js?_v=7730ce9d:194:141)
    at NodeList.forEach (<anonymous>)
    at Object.initialize (core-compiled.js?_v=7730ce9d:195:205)
    at Object.activate (core-compiled.js?_v=7730ce9d:44:468)
    at message.min.js?_v=7730ce9d:5:189
    at core-compiled.js?_v=7730ce9d:50:53
    at core-compiled.js?_v=7730ce9d:107:26
initLocationForm @ location-form-xf23.js?_v=7730ce9d:141
init @ location-form-xf23.js?_v=7730ce9d:96
c @ core-compiled.js?_v=7730ce9d:193
b @ core-compiled.js?_v=7730ce9d:194
initialize @ core-compiled.js?_v=7730ce9d:195
activate @ core-compiled.js?_v=7730ce9d:44
(anonymous) @ message.min.js?_v=7730ce9d:5
(anonymous) @ core-compiled.js?_v=7730ce9d:50
(anonymous) @ core-compiled.js?_v=7730ce9d:107
Promise.then
b @ core-compiled.js?_v=7730ce9d:106
setupHtmlInsert @ core-compiled.js?_v=7730ce9d:48
handleAjax @ message.min.js?_v=7730ce9d:5
l @ core-compiled.js?_v=7730ce9d:38
ajax @ core-compiled.js?_v=7730ce9d:41
await in ajax
click @ message.min.js?_v=7730ce9d:4
_onEvent @ core-compiled.js?_v=7730ce9d:190
a @ core-compiled.js?_v=7730ce9d:188
(anonymous) @ core-compiled.js?_v=7730ce9d:192

2. If I go to the edit URL directly, the addon mostly works and the dropdowns are updated according to the selected country/region. However, there are some countries that returns an error. I haven't made an exhaustive investigation but it fails if I select "Cocos Islands":
Code:
ErrorException: [E_WARNING] Undefined array key 0 in src/addons/AL/LocationField/Service/Data.php at line 110
[LIST=1]
[*]XF::handlePhpError() in src/addons/AL/LocationField/Service/Data.php at line 110
[*]AL\LocationField\Service\Data->getAvailableCityList() in src/addons/AL/LocationField/XF/Pub/Controller/Misc.php at line 37
[*]AL\LocationField\XF\Pub\Controller\Misc->actionLocationFieldLoadList() in src/XF/Mvc/Dispatcher.php at line 362
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
[*]XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2824
[*]XF\App->run() in src/XF.php at line 806
[*]XF::runApp() in index.php at line 23
[/LIST]


3. But for my particular use case, I do not need to select a country so I configure it to be read only and configured to my particular country. With this configuration, the drop downs are not updated at all so the State/Area dropdown is displayed correctly but the City dropdown is fixed at the cities from the first state in the list and doesn't get udpated when you select new states. This same behavior happens in the filter dropdown in the thread list page.


Any idea how to fix it?

Thank you for the report. We are working on the issues today and will have an update in the coming hours.
 
Back
Top Bottom