TypeError: strlen(): Argument #1 ($string) must be of type string, array given in Drupal\geocoder\DumperPluginManager->fixDumperFieldIncompatibility() (line 148 of modules/contrib/geocoder/src/DumperPluginManager.php). geocoder_field_entity_presave(Object

Created on 20 March 2024, 6 months ago

Problem/Motivation

Unable to create node

Steps to reproduce

Install and enable geocoder module
Install and enalbe address module
got to /admin/config/system/geocoder/geocoder-provider and add the Google Maps provider and add your google map API
Create your Address field in a content type
Create a Geocode Field and choose the address field as the field to geocode
Try to Create a node
Then you get the error beloow

The website encountered an unexpected error. Try again later.

TypeError: strlen(): Argument #1 ($string) must be of type string, array given in Drupal\geocoder\DumperPluginManager->fixDumperFieldIncompatibility() (line 148 of modules/contrib/geocoder/src/DumperPluginManager.php).
geocoder_field_entity_presave(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'geocoder_field') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_presave', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_presave', Array) (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook('presave', Object) (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object) (Line: 529)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 753)
Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object) (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 270)
Drupal\node\NodeForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('node_property_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ’ฌ Support request
Status

Closed: cannot reproduce

Version

4.23

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States docans

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @docans
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohd sahzad

    Mohd Sahzad โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !50fixed TypeError โ†’ (Open) created by mohd sahzad
  • Status changed to Needs review 6 months ago
  • Pipeline finished with Success
    6 months ago
    Total: 186s
    #123897
  • Status changed to Closed: cannot reproduce 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly itamair

    Thanks for reporting this and your contribution ...
    BUT all that you describe is not happening.

    I reproduced your use case (that is very common for the Drupal Geocoder module, and it thousands of adoptions)
    and all is working fine on my playground and testing envs,
    with Drupal 10 and 8.x-4.23 Geocoder release, and lates Address module (2.0.1) ...
    (none of the errors that you report here).

    Thus I am changing this into Support Request and to Minor priority,
    and closing this as "cannot reproduce", as indeed that's the case..

    Bear also in mind that your actual MR is probably making useless changes ($dumper_result) should always be a string because of the fixDumperFieldIncompatibility method definition) and (more bad) is introducing bad Drupal & PHP Coding standards issues (look the indentations ... ).

    All your issues should depend from some specifici (or wrong) configurations of your specific use case.

    PLEASE, don't change this back into Bug report, unless you could give clear evidence that you spotted a VERY General and reproducible use case / issue for every user ...

    Regards

Production build 0.71.5 2024