Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This might effectively be a dupe of #1853112: Replacement for Krumo?, but it'd be nice to find a short-term fix.
Consider the following snippet:
dpm(entity_create('comment', array('nid' => 1))->cid);
This fatals. Comment::$cid is no longer an int, but a FieldItem. See http://drupal.org/node/1806650 and http://drupal.org/node/1795854 for more.
The error is
InvalidArgumentException: Field krumo511bef056c0e3 is unknown. in Drupal\Core\Entity\Field\FieldItemBase->get() (line 116 of /Users/tim/www/d8/core/lib/Drupal/Core/Entity/Field/FieldItemBase.php).
It stems from \Drupal\Core\Entity\Field\Type\Field::__get().
Comments
Comment #1
jenlamptonI'm having a similar problem printing out a node. dpm($node) gives this:
I need this because debug doesn't work on nodes...
Comment #2
lussolucaWith the new Kint (or with the vardumper module) printing a TypedData object works correctly.
Comment #3
lussolucaComment #4
willzyx CreditAttribution: willzyx commented