Error when attempting to import transaction config

Created on 1 December 2022, over 2 years ago
Updated 12 April 2025, 15 days ago

Problem/Motivation

When I attempted to import my configuration that I've been working on across testing environments, I encountered this error:

Fatal error: Uncaught Error: Call to a member function label() on null in /var/www/html/web/modules/contrib/transaction/src/Plugin/Derivative/TransactionLocalTask.php:77
Stack trace:
#0 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\transaction\Plugin\Derivative\TransactionLocalTask->getDerivativeDefinitions(Array)
#1 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#2 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(285): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#3 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#4 /var/www/html/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(181): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#5 /var/www/html/web/modules/contrib/web in /var/www/html/web/modules/contrib/transaction/src/Plugin/Derivative/TransactionLocalTask.php on line 77
> PHP Fatal error:  Uncaught Error: Call to a member function label() on null in /var/www/html/web/modules/contrib/transaction/src/Plugin/Derivative/TransactionLocalTask.php:77
> Stack trace:
> #0 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\transaction\Plugin\Derivative\TransactionLocalTask->getDerivativeDefinitions(Array)
> #1 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
> #2 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(285): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
> #3 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
> #4 /var/www/html/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(181): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
> #5 /var/www/html/web/modules/contrib/web in /var/www/html/web/modules/contrib/transaction/src/Plugin/Derivative/TransactionLocalTask.php on line 77
>  [warning] Drush command terminated abnormally.

Steps to reproduce

  1. Configure a transaction type and configure in your system.
  2. Export the config into a repo for deployment (or however you export your config).
  3. Deploy the config to another computer (or server).
  4. Run drush cim
  5. Note the error above is present.

Proposed resolution

Wrap the derivative definition in an existence check to prevent this error. A cache clear once the configuration is in place will allow the derivative local tasks to build.

Remaining tasks

Create patch.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States merauluka

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.

  • πŸ‡ͺπŸ‡ΈSpain manuel.adan 🌌

    I was unable to reproduce it following the provided steps to reproduce. Nobody else reported being affected by this issue in this time. It could be something specific of your installation. Feel free to reopen if it happens again.

Production build 0.71.5 2024