Problem/Motivation

The WorkflowManager class contains some helper functions.
We already created a 'decorator' class WorkflowRole

Let us also create such a decorator class for the $transtition->targetEntity : WorkflowTargetEntity.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

johnv created an issue. See original summary.

  • johnv committed 8e5fb579 on 8.x-1.x
    Issue #3511999: Introduce class WorkflowTargetEntity - remove functions...

  • johnv committed 93fe59f7 on 8.x-1.x
    Issue #3511999: Introduce class WorkflowTargetEntity - move...

  • johnv committed ac12f5ac on 8.x-1.x
    Issue #3511999: Introduce class WorkflowTargetEntity - move...

  • johnv committed 6834cf9c on 8.x-1.x
    Issue #3511999: Introduce class WorkflowTargetEntity - cleanup
    
flyke’s picture

Just installed latest dev via:
composer require 'drupal/workflow:1.x-dev@dev'

And it throws lots of errors, for example if I try to do a
drush cr

PHP Fatal error:  Uncaught Error: Class "Drupal\workflow\Entity\WorkflowTargetEntity" not found in /var/www/html/web/modules/contrib/workflow/src/Hook/WorkflowViewsHooks.php:58
Stack trace:
#0 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(459): Drupal\workflow\Hook\WorkflowViewsHooks->viewsDataAlter()
#1 /var/www/html/web/core/modules/views/src/ViewsData.php(228): Drupal\Core\Extension\ModuleHandler->alter()
#2 /var/www/html/web/core/modules/views/src/ViewsData.php(142): Drupal\views\ViewsData->getData()
#3 /var/www/html/web/core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php(94): Drupal\views\ViewsData->get()
#4 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\views\Plugin\Derivative\ViewsEntityRow->getDerivativeDefinitions()
#5 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives()
#6 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(337): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#7 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(213): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#8 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#9 /var/www/html/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(16): Drupal\Core\Plugin\DefaultPluginManager->getDefinition()
#10 /var/www/html/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance()
#11 /var/www/html/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(824): Drupal\Component\Plugin\PluginManagerBase->createInstance()
#12 /var/www/html/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(133): Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin()
#13 /var/www/html/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(827): Drupal\views\Plugin\views\style\StylePluginBase->init()
#14 /var/www/html/web/core/modules/rest/src/Plugin/views/display/RestExport.php(348): Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin()
#15 /var/www/html/web/core/modules/views/src/EventSubscriber/RouteSubscriber.php(120): Drupal\rest\Plugin\views\display\RestExport->collectRoutes()
#16 [internal function]: Drupal\views\EventSubscriber\RouteSubscriber->routes()
#17 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func()
#18 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#19 /var/www/html/web/core/includes/common.inc(454): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#20 /var/www/html/web/core/includes/utility.inc(41): drupal_flush_all_caches()
#21 /var/www/html/vendor/drush/drush/src/Commands/core/CacheRebuildCommands.php(60): drupal_rebuild()
#22 [internal function]: Drush\Commands\core\CacheRebuildCommands->rebuild()
#23 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#24 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#25 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#26 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#27 /var/www/html/vendor/symfony/console/Command/Command.php(279): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#28 /var/www/html/vendor/symfony/console/Application.php(1094): Symfony\Component\Console\Command\Command->run()
#29 /var/www/html/vendor/symfony/console/Application.php(342): Symfony\Component\Console\Application->doRunCommand()
#30 /var/www/html/vendor/symfony/console/Application.php(193): Symfony\Component\Console\Application->doRun()
#31 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#32 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#33 /var/www/html/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
#34 /var/www/html/vendor/bin/drush.php(119): include('...')
#35 {main}
  thrown in /var/www/html/web/modules/contrib/workflow/src/Hook/WorkflowViewsHooks.php on line 58
johnv’s picture

Thanks for using and reporting on latest dev. It is much appreciated.
I did test your situation.
I do think that your caches were not flushed after updating to latest dev.

  • johnv committed 26b435dd on 8.x-1.x
    Issue #3511999: Introduce class WorkflowTargetEntity
    

  • johnv committed 18f98734 on 8.x-1.x
    Issue #3511999: Introduce class WorkflowTargetEntity
    
johnv’s picture

Forgive me my negligence, the new class was not committed at all..
This is no corrected.

  • johnv committed a43fdcb4 on 8.x-1.x
    Issue #3511999: Introduce class WorkflowTargetEntity
    
flyke’s picture

Thank you, the errors are gone now with the latest dev version.

johnv’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.