Address 2.0 module compatibility

Created on 21 November 2023, about 1 year ago
Updated 31 March 2024, 8 months ago

Problem/Motivation

The 2.0 version of the Address module has been delivered.
The last stable module version is not marked as compabitible but seems to work.
Maybe the address line 3 (introduced by the address 2/0 module) should be managed within address_suggestion.js?

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @superlolo95
  • Status changed to Closed: works as designed 12 months ago
  • 🇫🇷France lazzyvn paris

    test with address 2 it works.

  • 🇫🇷France cassien

    Hello guys,
    Not sure it works, I have that message after submission : This value should not be null.
    This is on a text field that is not empty. Suggestions appears properly. No error in the watchdog ...

  • Status changed to Needs review 11 months ago
  • 🇫🇷France lazzyvn paris

    Tested today with address 2 from scratch. Address 2 added Line 3 that's all
    Test with address field, text field, it works

  • 🇫🇷France cassien

    Many thanks for your really quick answer.
    I tested the module with an address field, it works.
    Do you tried with a simple text field ?
    I searched the error in the code, and I find it here :

    • commerce\modules\tax\tests\src\Kernel\TaxNumberItemTest.php /// line 234
    • inline_entity_form\tests\src\FunctionalJavascript\ComplexWidgetTest.php /// line 513

    The mystery thickens...

  • @lazzyvn,
    Indeed Address 2.0 introduced line 3.
    My question is th following.
    This new "Line 3" does not seems to be managed by Address suggestion module. Is it something expected?

    @cassien,
    I tested with an Address widget.

  • 🇫🇷France lazzyvn paris

    address suggestion always only works on address line 1, not on line 2 or line 3.
    @cassien I don't see any errors related to address suggestions in your case. Try debugging to see more information

  • 🇫🇷France cassien

    Re,

    As the address field displays the country code and two labels, I prefered to use the text field.

    I finally have the detailed error :

    Warning: Undefined array key "address" in Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget->massageFormValues() (line 200 of modules/contrib/address/src/Plugin/Field/FieldWidget/AddressDefaultWidget.php).
    Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget->massageFormValues(Array, Array, Object) (Line: 494)
    Drupal\Core\Field\WidgetBase->extractFormValues(Object, Array, Object) (Line: 240)
    Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues(Object, Array, Object) (Line: 334)
    Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity(Object, Array, Object) (Line: 301)
    Drupal\Core\Entity\EntityForm->buildEntity(Array, Object) (Line: 155)
    Drupal\Core\Entity\ContentEntityForm->buildEntity(Array, Object) (Line: 186)
    Drupal\Core\Entity\ContentEntityForm->validateForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 82)
    Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'node_ticket_form') (Line: 118)
    Drupal\Core\Form\FormValidator->validateForm('node_ticket_form', Array, Object) (Line: 593)
    Drupal\Core\Form\FormBuilder->processForm('node_ticket_form', Array, Object) (Line: 325)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
    Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'default') (Line: 191)
    Drupal\formblock\Plugin\Block\NodeFormBlock->build() (Line: 171)
    Drupal\block\BlockViewBuilder::preRender(Array)
    call_user_func_array('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 111)
    Drupal\Core\Render\Renderer->doTrustedCallback('Drupal\block\BlockViewBuilder::preRender', Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 858)
    Drupal\Core\Render\Renderer->doCallback('#pre_render', 'Drupal\block\BlockViewBuilder::preRender', Array) (Line: 421)
    Drupal\Core\Render\Renderer->doRender(Array) (Line: 493)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
    Drupal\Core\Render\Renderer->render(Array) (Line: 475)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 99)
    __TwigTemplate_5f2b9c65249ae8d64f0c9c7b22ba5755->doDisplay(Array, Array) (Line: 394)
    Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
    Twig\Template->display(Array) (Line: 379)
    Twig\Template->render(Array) (Line: 38)
    Twig\TemplateWrapper->render(Array) (Line: 39)
    twig_render_template('themes/custom/n5ut/templates/layout/page--node--1.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 480)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
    Drupal\Core\Render\Renderer->render(Array) (Line: 475)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 91)
    __TwigTemplate_57d45203095cb6667694709689354496->doDisplay(Array, Array) (Line: 394)
    Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
    Twig\Template->display(Array) (Line: 379)
    Twig\Template->render(Array) (Line: 38)
    Twig\TemplateWrapper->render(Array) (Line: 39)
    twig_render_template('themes/custom/n5ut/templates/layout/html.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 480)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
    Drupal\Core\Render\Renderer->render(Array) (Line: 158)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 153)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
    call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 186)
    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: 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)
  • 🇫🇷France lazzyvn paris

    @cassien You should repport error to module address

  • 🇫🇷France cassien

    I'll do that,
    Thanks again.

  • 🇫🇷France cassien

    I submitted the error: https://www.drupal.org/project/address/issues/3412340#comment-15383859 🐛 Error with address suggestion module Active
    It seems that address module is not the cause.

  • 🇫🇷France lazzyvn paris

    I guess your custom theme, suggestion js is not working with your custom modification. Debug by your side. try module with clear install drupal 10.2 from scratch.
    I tried with theme like claro, boostrap 5 admin, gin it worked without warning.

  • 🇫🇷France cassien

    Well, I didn't do custom modifications or hacks, just updated core and the previously installed contrib modules.
    Anyway, I'll use address field instead of text, and it will be ok :D

  • Status changed to Fixed 8 months ago
  • 🇫🇷France lazzyvn paris

    support address 2

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024