Problem/Motivation
TypeError: Drupal\layout_paragraphs\LayoutParagraphsLayoutTempstoreRepository::getWithStorageKey(): Argument #1 ($key) must be of type string, null given, called in /var/www/clients/client54/web163/web/modules/layout_paragraphs/src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php on line 156 w Drupal\layout_paragraphs\LayoutParagraphsLayoutTempstoreRepository->getWithStorageKey() (linia 51 w /var/www/clients/client54/web163/web/modules/layout_paragraphs/src/LayoutParagraphsLayoutTempstoreRepository.php)
Steps to reproduce
Upgrade from 2.0.0-beta5 to 2.0.0-beta6
my temporaty work around
changed line 154
to
if($layout_paragraphs_storage_key == NULL){
$this->layoutParagraphsLayout = new LayoutParagraphsLayout($items, $this->getSettings());
$this->tempstore->set($this->layoutParagraphsLayout);
$layout_paragraphs_storage_key = $this->tempstore->getStorageKey($this->layoutParagraphsLayout);
}else{
$this->layoutParagraphsLayout = $this->tempstore->getWithStorageKey($layout_paragraphs_storage_key);
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | null-storage-key-3258742-3.patch | 1.2 KB | nuuou |
Issue fork layout_paragraphs-3258742
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 #2
avpadernoComment #3
nuuou commentedMoved the code from the start of this issue into a patch file.
No idea if this is the "proper" way to fix this issue or anything, but it did fix the issue for me on 2.0.0-beta6.
Comment #4
avpadernoComment #5
gryfini commentedthis code look better
whole function formElement
Comment #8
justin2pin commentedThanks all - this should be fixed.