When set rule to save "entity", it throw this error:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\rules\Plugin\RulesAction\EntitySave::doExecute() must implement interface Drupal\Core\Entity\EntityInterface, string given in Drupal\rules\Plugin\RulesAction\EntitySave->doExecute() (line 48 of modules/rules/src/Plugin/RulesAction/EntitySave.php).

How to replicate?

  1. Create a rule
  2. Add a new action of "Entity Save" type

When rule targeted event happens, it throws the error on frontend.

Also,

When added a condition to find entity field, it throw this error:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\rules\Plugin\Condition\EntityHasField::doEvaluate() must implement interface Drupal\Core\Entity\FieldableEntityInterface, string given in Drupal\rules\Plugin\Condition\EntityHasField->doEvaluate() (line 42 of modules/rules/src/Plugin/Condition/EntityHasField.php).

Comments

admirernepali created an issue. See original summary.

admirernepali’s picture

Title: doEvaluate() must implement interface Drupal\Core\Entity\FieldableEntityInterface, string given » doExecute() must implement interface Drupal\Core\Entity\EntityInterface, string given
Issue summary: View changes
shabana.navas’s picture

TR’s picture

Status: Active » Closed (duplicate)

How to replicate?

  1. Create a rule
  2. Add a new action of "Entity Save" type

Well, you left out all the important steps, like how you configured your Rule. This is why it's important to ALWAYS export your Rule and post it so we can see EXACTLY how you've configured things. And in this case, I'm guessing you configured it wrong, but I can't be sure because you didn't show your work.

Marking as duplicate of #2776109: Recoverable fatal error: Argument 1 passed must implement FieldableEntityInterface. If it's not, then feel free to reopen this issue ALONG WITH AN EXPORT OF YOUR RULE.