Describe your bug or feature request.

destination=/views/ajax in the views operational links.

Steps to reproduce:

  1. enable commerce_product, views
  2. create store, create product with sku.
  3. create view. with Show: Product Variation.
  4. add "operations links" to the Fields.
  5. add exposed SKU to filters.
  6. check "Use Ajax"

After filter will be processed with ajax the operations links in variations will have destination=/views/ajax

Issue fork commerce-3588656

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

andriic created an issue. See original summary.

andriic’s picture

Status: Active » Needs review
jsacksick’s picture

Status: Needs review » Needs work

Setting to needs work due to the test failures.

andriic’s picture

Status: Needs work » Needs review

hi @jsacksick
tests were fixed with the latest 3.x merge

andriic’s picture

Version: 3.0.x-dev » 3.x-dev
jsacksick’s picture

Status: Needs review » Needs work
jsacksick’s picture

Maybe what we need is this:

  /**
   * {@inheritdoc}
   */
  public function getDefaultOperations(EntityInterface $entity/* , ?CacheableMetadata $cacheability = NULL */) {
    $operations = parent::getDefaultOperations($entity);

    $destination = $this->redirectDestination->get();
    foreach ($operations as $key => $operation) {
      $operations[$key]['query']['destination'] = $destination;
    }

    return $operations;
  }

From MenuLinkListBuilder. Also as mentioned in the MR, there is no need for the fallback, as there is already a fallback to <current> within the get method.

andriic’s picture

Status: Needs work » Needs review

  • jsacksick committed c39cc64a on 3.x authored by andriic
    fix: #3588656 Variation operations link broken on views ajax
    
    By:...
jsacksick’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.