I use the lasted dev version of rules and with the commit "d73d756", I get this error:
[Thu Oct 06 20:59:58.716321 2016] [:error] [pid 402] [client 172.17.0.2:58773] PHP Fatal error: Trait 'Drupal\\typed_data\\DataFetcherTrait' not found in /var/www/html/htdocs/docroot/web/modules/contrib/rules/src/Engine/ExecutionState.php on line 22, referer: http://test.docker/en/admin/config/workflow/rules/reactions/add
I figured out, that there is an dependency to typed_data. I added this modules to the project, active it. But still I get this error.
File: ExecutionState.php
[...]
use Drupal\rules\Exception\InvalidArgumentException;
use Drupal\typed_data\DataFetcherTrait;
class ExecutionState implements ExecutionStateInterface {
use DataFetcherTrait;
use GlobalContextRepositoryTrait;
use TypedDataTrait;
File: DataFetcherTrait.php
namespace Drupal\typed_data;
/**
* Wrapper methods for classes that need the data fetcher object.
*/
trait DataFetcherTrait {
What is wrong here?
Comments
Comment #2
fagoMake sure the typed_data module is installed and your caches are rebuilt. If that does not help, try restarting apache/PHP.
Comment #3
lykyd commentedHere is the module page : https://www.drupal.org/project/typed_data
Comment #4
jjchinquistThis error is occurring from a clean install of the module and running the tests. Does it mean that the test should be changed to remove this dependency or that a module dependency should be created?
Comment #5
jjchinquistWe may just try to add to the documentation. As soon as the module is added via composer require, the tests work.
Comment #6
tr commentedI'm sure this isn't a problem any more. When DataFetcher was moved over to the typed_data module, I'm sure there were some glitches such as caches that need rebuilding. Also, the rules.info.yml wasn't updated immediately with the new dependency.
I'm not sure what the problem was with #4 and #5, but composer is definitely not required for this to work. I have not see this error, and I have installed rules/typed_data hundreds of time on clean systems. Note that there have been several commits in the past year which might affect this on certain systems: #2993701: Wrong indentation in rules.info.yml and #2903855: Fix coding standards and coding style issues
If this is still a problem with the current version of Rules / Typed Data API Enhancements, then please open a new issue.