Error: Call to a member function getUntranslatedString() on string

Created on 25 October 2022, over 1 year ago
Updated 3 October 2023, 9 months ago

I get this error after updating the Group module.

Error: Call to a member function getUntranslatedString() on string in Drupal\group\Access\GroupPermissionHandler->getPermissionsIncludingPlugins() (line 143 of src/Access/GroupPermissionHandler.php).

πŸ’¬ Support request
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium betz

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.

  • πŸ‡³πŸ‡±Netherlands ricovandevin

    I can confirm that the issue was originating from custom code in our case. We can fix it there.

  • πŸ‡§πŸ‡ͺBelgium betz

    The plugin in my case is the gnode groupnode contentenabler.
    The label is a string, the description is a TranslatableMarkup, for some reason.

  • πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

    For clarity, this is what I did to cause this error:

    In a custom Deriver class, getDerivativeDefinitions method, I changed this:

          $this->derivatives[$name]->set('label', t('Organization site (@type)', ['@type' => $label]));
    

    to this:

          $this->derivatives[$name]->set('label', t($label));
    
    

    Instead of doing logic checks, I think it would be simpler to create a setLabel() method so that you could force the parameter to be TranslatableMarkup. There is already a getLabel() method.

Production build 0.69.0 2024