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

Latest optimisation is sort order query breaks media copy for single file collections #3015

Closed
victor-priceputu opened this issue Aug 29, 2022 · 4 comments

Comments

@victor-priceputu
Copy link

victor-priceputu commented Aug 29, 2022

  1. Create a model
  2. Attach a media to the model, after registering the media collection as a single file.
  3. Attach another media to the model (basically have 1 media item with order 2)
  4. Move another media from another model to this one

Expected: the new media would belong to the model
Actual: the old media belongs to the model

This can be replicated with other steps as well, for example:
Have a model with 2 media items (which have order 1 and 2)
Move a media item from another model (that has the order 1)

The copied media has order 1, not 3. Biggest issue is in Single model collections.

Because copy persist the order of the media, of that order number is lower than the latest entry you have for the model, then the order of the collection is broken. When using single file collection it completely breaks the copy functionality.

Issue introduced with the optimisation in #2840

@freekmurze
Copy link
Member

Could you PR a tests that proves that this is broken?

@victor-priceputu
Copy link
Author

I will make one as soon as I can spare some time

@victor-priceputu
Copy link
Author

PR created with the test, that is failing locally. Thank you for looking into this

@spatie-bot
Copy link

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

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

No branches or pull requests

4 participants