Problem/Motivation

When I click into the 'Salesforce' tab and try to push an entity I receive the following error:

ArgumentCountError: Too few arguments to function Drupal\salesforce_mapping\Plugin\Validation\Constraint\UniqueFieldsConstraintValidator::__construct(), 0 passed in web/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php on line 31 and exactly 1 expected in Drupal\salesforce_mapping\Plugin\Validation\Constraint\UniqueFieldsConstraintValidator->__construct()

Steps to reproduce

Use salesforce mapping UI to push an entity from Drupal to salesforce.

Proposed resolution

Use ContainerInjectionInterface class.

Issue fork salesforce-3419551

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

omarlopesino created an issue. See original summary.

omarlopesino’s picture

Assigned: Unassigned » omarlopesino
dineshkumarbollu’s picture

Hi @omarlopesino

using these classes will resolve the problem.

use Drupal\Core\DependencyInjection\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

and in create method add new paramenters

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {

omarlopesino’s picture

Assigned: omarlopesino » Unassigned
omarlopesino’s picture

Thank you @dineshkumarbollu . Indeed I've already made that solution but forgot to create the MR. Now the MR is created. Please review, thanks!

omarlopesino’s picture

Status: Active » Needs review

aaronbauman’s picture

Status: Needs review » Fixed

Committed to latest dev, thanks for the patch.

Status: Fixed » Closed (fixed)

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