Commit d17cd6aa authored by geekia's avatar geekia Committed by Manuel Egío
Browse files

Issue #3269036 by jmaties: Render #pre_render callbacks must be methods of a...

Issue #3269036 by jmaties: Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function
parent 39bfd4ac
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ use Drupal\Core\Render\Element\Fieldset;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\entity_counter\EntityCounterConditionGroup;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Security\TrustedCallbackInterface;

/**
 * Provides a base class for an entity counter source with conditions.
@@ -23,7 +24,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
 * @see \Drupal\entity_counter\Plugin\EntityCounterSourceManagerInterface
 * @see plugin_api
 */
abstract class EntityCounterSourceBaseWithEntityConditions extends EntityCounterSourceBase implements EntityCounterSourceWithConditionsInterface {
abstract class EntityCounterSourceBaseWithEntityConditions extends EntityCounterSourceBase implements EntityCounterSourceWithConditionsInterface, TrustedCallbackInterface {

  use ConditionAccessResolverTrait;

@@ -107,6 +108,13 @@ abstract class EntityCounterSourceBaseWithEntityConditions extends EntityCounter
    );
  }

   /**
   * {@inheritdoc}
   */
  public static function trustedCallbacks() {
    return ['preRenderForm'];
  }

  /**
   * Callback #pre_render for conditions_form form element.
   *