Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STU-175] Attempt to read property "name" on null #39

Open
janhenckens opened this issue Sep 2, 2024 · 8 comments
Open

[STU-175] Attempt to read property "name" on null #39

janhenckens opened this issue Sep 2, 2024 · 8 comments

Comments

@janhenckens
Copy link
Member

janhenckens commented Sep 2, 2024

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: #0 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(79): yii\base\ErrorHandler->handleError(2, 'Attempt to read...', '/var/www/html/v...', 48) #1 /var/www/html/vendor/studioespresso/craft-easyaddressfield/src/services/FieldService.php(48): craft\web\ErrorHandler->handleError(2, 'Attempt to read...', '/var/www/html/v...', 48) #2 /var/www/html/vendor/studioespresso/craft-easyaddressfield/src/fields/EasyAddressFieldField.php(201): studioespresso\easyaddressfield\services\FieldService->saveField(Object(studioespresso\easyaddressfield\fields\EasyAddressFieldField), Object(craft\elements\Entry)) #3 /var/www/html/vendor/craftcms/cms/src/base/Element.php(5164): studioespresso\easyaddressfield\fields\EasyAddressFieldField->afterElementSave(Object(craft\elements\Entry), false) #4 /var/www/html/vendor/craftcms/cms/src/elements/Entry.php(2023): craft\base\Element->afterSave(false) #5 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(3461): craft\elements\Entry->afterSave(false) #6 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(1114): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), false, true, true, Array, false, false) #7 /var/www/html/vendor/craftcms/cms/src/services/Drafts.php(382): craft\services\Elements->saveElement(Object(craft\elements\Entry), false) #8 /var/www/html/vendor/craftcms/cms/src/services/Drafts.php(318): craft\services\Drafts->removeDraftData(Object(craft\elements\Entry)) #9 /var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(1510): craft\services\Drafts->applyDraft(Object(craft\elements\Entry)) #10 [internal function]: craft\controllers\ElementsController->actionApplyDraft() #11 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #12 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array) #13 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('apply-draft', Array) #14 /var/www/html/vendor/craftcms/cms/src/web/Application.php(340): yii\base\Module->runAction('elements/apply-...', Array) #15 /var/www/html/vendor/craftcms/cms/src/web/Application.php(639): craft\web\Application->runAction('elements/apply-...', Array) #16 /var/www/html/vendor/craftcms/cms/src/web/Application.php(302): craft\web\Application->_processActionRequest(Object(craft\web\Request)) #17 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request)) #18 /var/www/html/web/index.php(12): yii\base\Application->run() #19 {main}

Originally posted by @wolf-ms in #37 (comment)

STU-175

@janhenckens janhenckens changed the title Attempt to read property "name" on null [STU-175] Attempt to read property "name" on null Sep 2, 2024
@wolf-ms
Copy link

wolf-ms commented Sep 6, 2024

@janhenckens Just checking in to see if there's been an update on this or whether I need to provide more info. Thanks!

@janhenckens
Copy link
Member Author

Hey @wolf-ms, I haven't gotten the chance to look into it further, will try to get back to you early next week!

janhenckens added a commit that referenced this issue Sep 9, 2024
@janhenckens
Copy link
Member Author

@wolf-ms should be fixed in 4.0.11 (and 5.0.2 for Craft 5) - can you give that a try? Thanks!

@wolf-ms
Copy link

wolf-ms commented Sep 9, 2024

Thanks for looking into this @janhenckens ! The 'Attempt to read property "name" on null' no longer appears when I save an entry, but the longitude/latitude coordinates are not populating after save. The 'Pick an address on the map" option isn't working either if it's a new entry and the coordinates haven't been generated yet. It just shows a blank modal with Cancel and Done buttons (the Cancel button doesn't work).

@janhenckens
Copy link
Member Author

Could you share an example of an address you're seeing this with @wolf-ms?

@janhenckens janhenckens reopened this Sep 9, 2024
@wolf-ms
Copy link

wolf-ms commented Sep 9, 2024

@janhenckens Attaching a screenshot with an address
Address-field

@janhenckens
Copy link
Member Author

Thanks! I think you're also running into an access issue with OpenStreetMaps but I'll have to investigate further.

@wolf-ms
Copy link

wolf-ms commented Sep 13, 2024

@janhenckens yes, wondering if Nominatim needs a user agent sent with the request header or something else to prevent the blocking. Appreciating your help with this, but it's getting to be crunch time with this project and I may need to go another route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants