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

Nested Docs Plugin causing error with versions #10068

Closed
DesignyourCode opened this issue Dec 19, 2024 · 1 comment · Fixed by #10313
Closed

Nested Docs Plugin causing error with versions #10068

DesignyourCode opened this issue Dec 19, 2024 · 1 comment · Fixed by #10313
Assignees

Comments

@DesignyourCode
Copy link

Describe the Bug

I am using the website template on the latest version (3.9.0) and when trying to access the "Versions" against a collection (in my case categories or pages) I get the following error:

Error: "oldValue" and "newValue" should be strings

I believe this is because both collections are set to be nested using the nested docs plugin. If I remove nesting from each in turn the versions work again. But in my case I need pages to be nested.

Link to the code that reproduces this issue

https://github.com/DesignyourCode/payload-nested-version-bug

Reproduction Steps

  1. Clone website template
  2. Add pages to nested plugin options
  3. Create a document and modify to create versions
  4. Try to access the versions

Which area(s) are affected? (Select all that apply)

plugin: nested-docs

Environment Info

Binaries:
  Node: 22.7.0
  npm: 10.8.2
  Yarn: 1.22.19
  pnpm: 9.15.0
Relevant Packages:
  payload: 3.9.0
  next: 15.0.4
  @payloadcms/db-postgres: 3.9.0
  @payloadcms/email-nodemailer: 3.9.0
  @payloadcms/graphql: 3.9.0
  @payloadcms/live-preview: 3.9.0
  @payloadcms/live-preview-react: 3.9.0
  @payloadcms/next/utilities: 3.9.0
  @payloadcms/payload-cloud: 3.9.0
  @payloadcms/plugin-cloud-storage: 3.9.0
  @payloadcms/plugin-form-builder: 3.9.0
  @payloadcms/plugin-nested-docs: 3.9.0
  @payloadcms/plugin-redirects: 3.9.0
  @payloadcms/plugin-search: 3.9.0
  @payloadcms/plugin-seo: 3.9.0
  @payloadcms/richtext-lexical: 3.9.0
  @payloadcms/storage-vercel-blob: 3.9.0
  @payloadcms/translations: 3.9.0
  @payloadcms/ui/shared: 3.9.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:27 PDT 2024; root:xnu-11215.41.3~2/RELEASE_X86_64
  Available memory (MB): 16384
  Available CPU cores: 12
@paulpopus
Copy link
Contributor

Nice catch on this bug, it actually was related to the react diff viewer component and postgres specifically. My fix will make sure that the IDs are always a string instead of a number.

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

Successfully merging a pull request may close this issue.

2 participants