Problem using paragraphs table in user profile

Created on 18 October 2022, about 2 years ago
Updated 23 January 2023, almost 2 years ago

HI,
I upgrade from version 8.x-1.8 to 8.x-1.10 and when I try to view user/1 page I got an error:

Error: Call to undefined method Drupal\user\Entity\User::getType() in Drupal\paragraphs_table\Plugin\Field\FieldFormatter\ParagraphsTableFormatter->viewElements() (line 351 of /modules/paragraphs_table/src/Plugin/Field/FieldFormatter/ParagraphsTableFormatter.php)

I'm using paragraphs in user profile so the code:

$context = [
      'paragraph_name' => $bundles[$type]['label'],
      'paragraph_type' => $type,
      'entity_type' => $entity->getType(), ///ERROR HERE
      'entity_field' => $field_name_current,
      'entity_id' => $entityId,
    ]

generates the error...

To reproduce: add paragraph in user profile and rapresent with paragraphs table.

tks,
Antonio

🐛 Bug report
Status

Fixed

Version

1.10

Component

Code

Created by

🇮🇹Italy antonio.bertolini

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024