Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Can't move the last variant in the variant list #16103

Open
WHITE-developer opened this issue Nov 13, 2024 · 3 comments
Open

[5.x]: Can't move the last variant in the variant list #16103

WHITE-developer opened this issue Nov 13, 2024 · 3 comments
Assignees
Labels

Comments

@WHITE-developer
Copy link

What happened?

Description

We have an product with more then 50 variants but when we we want to reorder the last variant of the page we get an JavaScript error.
Maybe related to: #16026

Steps to reproduce

  1. Create a product.
  2. Add more than 50 variants to the product (e.g., 55 variants).
  3. move the last variant

Expected behavior

The variant should be at the position it’s dragged to.
Reordering should work consistently, allowing users to adjust the order of the variants.

Actual behavior

The variant won't reorder and we get an JavaScript error in the console:
Uncaught (in promise) ye {message: 'Request failed with status code 400', name: 'AxiosError', code: 'ERR_BAD_REQUEST', config: {…}, request: XMLHttpRequest, …}
We can't reorder any other variants. I tried to move the last variant 3 times and get the same error 3 times:
Image

Craft CMS version

5.4.10

PHP version

8.3.8

Operating system and version

No response

Database type and version

MySQL 8.0.37

Image driver and version

No response

Installed plugins and versions

-Commerce: 5.x-dev

@i-just
Copy link
Contributor

i-just commented Nov 13, 2024

Hi, thanks for reporting! I raised a PR for this.

@WHITE-developer
Copy link
Author

We also have a different problem when I move an disabled variant:
Image
And save the page with "ctrl" + "s" the whole layout of variants changes:
Image
In the first image, we initially had two disabled products stacked above each other, with our moved variant positioned below them. However, after saving the page, the arrangement changed. Now, either:

  • Two enabled variants have moved up, or
  • Our moved variant has shifted down, now paired with another disabled variant.

@i-just
Copy link
Contributor

i-just commented Nov 15, 2024

Thanks! That’s a separate issue, and it only affects Commerce variants, so I raised it in the Commerce repo (along with a PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants