-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Cannot use orderable on collections with both SEO plugin and autosaving drafts #12212
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
Comments
We found the cause of the issue. We will keep working on this PR to resolve it. #12331 |
5 tasks
DanRibbens
added a commit
that referenced
this issue
May 16, 2025
⚠️ `orderable` fields will no longer be `required` and `unique`, so your database may prompt you to accept an automatic migration if you're using [this feature](https://payloadcms.com/docs/configuration/collections#config-options). Note that the `orderable` feature is still experimental, so it may still receive breaking changes without a major upgrade or contain bugs. Use it with caution. ___ The `orderable` fields will not have `required` and `unique` constraints at the database schema level, in order to automatically migrate collections that incorporate this property. Now, when a user adds the `orderable` property to a collection or join field, existing documents will have the order field set to undefined. The first time you try to reorder them, the documents will be automatically assigned an initial order, and you will be prompted to refresh the page. We believe this provides a better development experience than having to manually migrate data with a script. Additionally, it fixes a bug that occurred when using `orderable` in conjunction with groups and tabs fields. Closes: - #12129 - #12331 - #12212 --------- Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
This should be fixed with #12422. It will be in the next release. |
kendelljoseph
pushed a commit
that referenced
this issue
May 19, 2025
⚠️ `orderable` fields will no longer be `required` and `unique`, so your database may prompt you to accept an automatic migration if you're using [this feature](https://payloadcms.com/docs/configuration/collections#config-options). Note that the `orderable` feature is still experimental, so it may still receive breaking changes without a major upgrade or contain bugs. Use it with caution. ___ The `orderable` fields will not have `required` and `unique` constraints at the database schema level, in order to automatically migrate collections that incorporate this property. Now, when a user adds the `orderable` property to a collection or join field, existing documents will have the order field set to undefined. The first time you try to reorder them, the documents will be automatically assigned an initial order, and you will be prompted to refresh the page. We believe this provides a better development experience than having to manually migrate data with a script. Additionally, it fixes a bug that occurred when using `orderable` in conjunction with groups and tabs fields. Closes: - #12129 - #12331 - #12212 --------- Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
This issue has been automatically locked. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the Bug
Hello,
I recently opened an issue that was closed as I could not provide a complete reproduction.
I've been able to replicate the two issues I was having:
orderable
featureTo replicate this, you need the following on your collection:
orderable: true
@payloadcms/plugin-seo
plugin enabled for your collectionautosave
I've seen my previous issue mentioned in PR #12129 and I did originally have my hunch set on this being my issue - but even without tabs I am getting my mentioned issues.
I believe I have provided a sufficient reproduction now that outlines the issues I was experiencing but only when the specifics mentioned above are being used.
Link to the code that reproduces this issue
https://github.com/joedawson/orderable-issue/
Reproduction Steps
orderable: true
in thethemes
collection/api/handle
to attempt to migrate the data_order
value but all subsequent documents will fail:Which area(s) are affected? (Select all that apply)
plugin: seo, area: core
Environment Info
The text was updated successfully, but these errors were encountered: