You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to load a node with layout builder customized for that node in the drush console.
$ drush php
Psy Shell v0.11.0 (PHP 8.1.3 — cli) by Justin Hileman
Drush Site-Install (Drupal 10.2.8)
>>> $etm=\Drupal::entityTypeManager();
=> Drupal\Core\Entity\EntityTypeManager {#1248}
>>> $ns=$etm->getStorage('node');
=> Drupal\node\NodeStorage {#7630}
>>> $n35=$ns->load(35);
PHP Error: Object of class Drupal\layout_builder\Section could not be converted to string in /app/vendor/drush/drush/src/Psysh/Caster.php on line 46
Expected behavior
Node is loaded.
Workaround
I edited drush/src/Psysh/Caster.php line 46.
// Collapse single value'd field values.
if (count($value[0] ?? []) === 1) {
$to_implode = array_filter(array_column($value, array_keys($value[0])[0]), fn ($v) => is_string($v));
$value = implode(', ', $to_implode);
}
System Configuration
Q
A
Drush version?
12.5.2 (please be specific, and try latest release)
Drupal version?
10.2.8
PHP version
8.1.3
OS?
Linux
With layout builder enabled and made enabled for overrides per node.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm trying to load a node with layout builder customized for that node in the drush console.
Expected behavior
Node is loaded.
Workaround
I edited
drush/src/Psysh/Caster.php
line 46.System Configuration
With layout builder enabled and made enabled for overrides per node.
The text was updated successfully, but these errors were encountered: