Closed mike-moreau closed 1 month ago
Hey @mike-moreau, that's an issue on the OpenStreetMaps side but the plugin could probably handle the error better (saving a new entry can also cause the page to cause when this error happens).
I'll try to get an update out with better error handling this week, and secondarily I have a look at adding another service/option for Geolocation to the plugin (we had Google Geocoding in the past, might add that in again).
Hi. Can we get an update or a workaround here please? Seems like we can no longer save entries with this field in them.
Hey @smockensturm, I have an update out for the Craft 4 version that addresses this but still have to add that to the Craft 5 version.
If you're Craft 4 you can update tot 4.0.9 - for Craft 5 I'll try to have an update out by Friday!
Cool. Thank you @janhenckens Any way I can get this into Craft 3.9.13?
Yeps, since this crash is pretty inconvenient I added it to Craft 3 as well. Fixed in 3.1.2!
Appreciate it @janhenckens Updated. But we're having a devil of a time with the OSM errors.
Attempt to read property "name" on null
What are we doing wrong? This is happening on new entries with this field type. Older entries (with address data) re-save just fine.
@smockensturm Could you shared the full stack trace of the error?
Sure thing @janhenckens Here you go.
yii\base\ErrorException: Attempt to read property "name" on null in /Users/stevemockensturm/Documents/sites/healthpartners/vendor/studioespresso/craft-easyaddressfield/src/services/FieldService.php:46
Stack trace:
#0 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/web/ErrorHandler.php(87): yii\base\ErrorHandler->handleError(2, 'Attempt to read...', '/Users/stevemoc...', 46)
#1 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/studioespresso/craft-easyaddressfield/src/services/FieldService.php(46): craft\web\ErrorHandler->handleError(2, 'Attempt to read...', '/Users/stevemoc...', 46)
#2 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/studioespresso/craft-easyaddressfield/src/fields/EasyAddressFieldField.php(208): studioespresso\easyaddressfield\services\FieldService->saveField(Object(studioespresso\easyaddressfield\fields\EasyAddressFieldField), Object(craft\elements\Entry))
#3 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/base/Element.php(4205): studioespresso\easyaddressfield\fields\EasyAddressFieldField->afterElementSave(Object(craft\elements\Entry), false)
#4 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/elements/Entry.php(1712): craft\base\Element->afterSave(false)
#5 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/services/Elements.php(2732): craft\elements\Entry->afterSave(false)
#6 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/services/Elements.php(785): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), true, false, true)
#7 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/controllers/EntriesController.php(409): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#8 [internal function]: craft\controllers\EntriesController->actionSaveEntry(false)
#9 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#11 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save-entry', Array)
#12 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/web/Application.php(295): yii\base\Module->runAction('entries/save-en...', Array)
#13 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/web/Application.php(608): craft\web\Application->runAction('entries/save-en...', Array)
#14 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/craftcms/cms/src/web/Application.php(274): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#15 /Users/stevemockensturm/Documents/sites/healthpartners/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#16 /Users/stevemockensturm/Documents/sites/healthpartners/public/index.php(22): yii\base\Application->run()
#17 /Users/stevemockensturm/.composer/vendor/laravel/valet/server.php(250): require('/Users/stevemoc...')
#18 {main}
Hey @smockensturm, could you try updating to 3.1.3 to see if that fixes this?
Legend! @janhenckens thank you so, so much for the extra effort.
Cheers :)
Hello, I'm encountering a similar issue while using v.4.0.10 on Craft 4.11.5.
`yii\base\ErrorException: Attempt to read property "name" on null in /var/www/html/vendor/studioespresso/craft-easyaddressfield/src/services/FieldService.php:48 Stack trace:
I created a new issue for this @wolf-ms => https://github.com/studioespresso/craft-easyaddressfield/issues/39
I've getting the error when attempting to use an Easy Address Field version 4.0.8 on Craft 4.9.4
Looks like this in the logs:
Is this an issue on their end, or the plugin itself?
STU-165