Skip to content

[5.x]: actionPurchasablesTable in order view broken #3986

@gopeter

Description

@gopeter

What happened?

Description

Since this commit, the purchasables table in the order is broken, as you can see in this screenshot:

Image

It shows just one result, but according to the pagination, it should be list 10 purchasables.

This happens because the mentioned commit filters the result arrays but not the pagination one:

return $this->asSuccess(data: [
  'pagination' => AdminTable::paginationLinks($page, $total, $limit),
  'data' => $this->_addLivePurchasableInfo($result, $siteId, $customerId),
]);

The $total should change after _addLivePurchasableInfo filtered the data.

Steps to reproduce

  1. Create a shop with multiple sites
  2. Create a few variants which are enabled either in one or the other site
  3. Create an order and add line items manually – the purchasable list is now incomplete because of the faulty paginaiton

Craft CMS version

Craft Pro 5.6.17

Craft Commerce version

5.3.8

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions