Problem/Motivation
Trying to save an entity programmatically on a psy console results in the following warning and error:
WARNING Attempt to read property "attributes" on null in modules/contrib/geocoder/modules/geocoder_field/geocoder_field.module on line 179.
Error Call to a member function get() on null.
Steps to reproduce
Open a drush cli with `drush php`
Create and save a node like this
$node = \Drupal\node\Entity\Node::create(['type' => 'article', 'title' => 'test']);
$node->save();
Related issue (can't add it on d.o):
#3301512: Extend the ability to skip geocoding when processing a large number of entity updates, like migrations or workspace publishing
Proposed resolution
Don't assume there is always a request
Remaining tasks
Code
User interface changes
None
API changes
None
Data model changes
None
Issue fork geocoder-3619252
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
rodrigoaguileraComment #4
rodrigoaguileraComment #5
amateescu commentedPosted a code suggestion on the MR, otherwise this looks good to me.
Comment #6
itamair commentedThx @rodrigoaguilera.
I could reproduce and your MR !83 fixes this issue.
Going to merge into 8.x-4.x, will be parto of next Geocoder release.
Comment #7
itamair commentedComment #10
tobiasbFor people who ask themselves, this was never a problem, or project B does not have it.
Drupal Core 11.4 is the source. #2613044: Requests are pushed onto the request stack twice, popped once