Verified Commit 88fab0ba authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3299859 by andypost, Anchal_gupta, longwave, alexpott: Remove...

Issue #3299859 by andypost, Anchal_gupta, longwave, alexpott: Remove AllowDynamicProperties attribute from JoinPluginBase
parent defcb862
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -150,7 +150,6 @@
 *
 * Extensions of this class can be used to create more interesting joins.
 */
#[\AllowDynamicProperties]
class JoinPluginBase extends PluginBase implements JoinPluginInterface {

  /**
+10 −2
Original line number Diff line number Diff line
@@ -63,6 +63,13 @@ class ViewsQueryAlter implements ContainerInjectionInterface {
   */
  protected $languageManager;

  /**
   * An array of tables adjusted for workspace_association join.
   *
   * @var \WeakMap
   */
  protected \WeakMap $adjustedTables;

  /**
   * Constructs a new ViewsQueryAlter instance.
   *
@@ -86,6 +93,7 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Ent
    $this->viewsData = $views_data;
    $this->viewsJoinPluginManager = $views_join_plugin_manager;
    $this->languageManager = $language_manager;
    $this->adjustedTables = new \WeakMap();
  }

  /**
@@ -345,7 +353,7 @@ protected function ensureRevisionTable(EntityTypeInterface $entity_type, Sql $qu
        // If this table previously existed, but was not added by us, we need
        // to modify the join and make sure that 'workspace_association' comes
        // first.
        if (empty($table_queue[$alias]['join']->workspace_adjusted)) {
        if (!$this->adjustedTables->offsetExists($table_queue[$alias]['join'])) {
          $table_queue[$alias]['join'] = $this->getRevisionTableJoin($relationship, $base_revision_table, $revision_field, $workspace_association_table, $entity_type);
          // We also have to ensure that our 'workspace_association' comes before
          // this.
@@ -398,7 +406,7 @@ protected function getRevisionTableJoin($relationship, $table, $field, $workspac
    /** @var \Drupal\views\Plugin\views\join\JoinPluginInterface $join */
    $join = $this->viewsJoinPluginManager->createInstance('standard', $definition);
    $join->adjusted = TRUE;
    $join->workspace_adjusted = TRUE;
    $this->adjustedTables[$join] = TRUE;

    return $join;
  }