- Issue created by @lazzyvn
- 🇮🇳India arunsahijpal
Hi @lazzyvn,
I've followed the same steps but i didn't get any error.@bojanz could pls look into this
Thanks
I added an address field with country as default value to a content type. When I automatically create a node without an address field,
$node = Node::create([
'type' => 'article',
'title' => 'test without address',
'status' => 1, // Publish node.
]);
it creates an address field with country as default value. (it checks the default value before setting the value) but the node does not show because the address field is empty.
TypeError : Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in C:\www\drupal\web\modules\contrib\address\src\Plugin\Field\FieldFormatter\AddressDefaultFormatter.php on line 162 dans Drupal\Component\Utility\Html::escape() (ligne 431 de C:\www\drupal\web\core\lib\Drupal\Component\Utility\Html.php).
To avoid fatal errors I suggest patching this before fixed the default country value.
Active
2.1
Code
Hi @lazzyvn,
I've followed the same steps but i didn't get any error.
@bojanz could pls look into this
Thanks