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

Deploying content entries with many_to_many relationship fails when field required: true #402

Open
greyskin opened this issue Aug 6, 2021 · 0 comments

Comments

@greyskin
Copy link

greyskin commented Aug 6, 2021

Steps to reproduce:

  1. Create 2 content_types with a many_to_many relationship as per the Locomotive Docs.
  2. Set a required: true attribute on one (or both) of the many_to_many fields in each content_type.
  3. Ensure there is at least one data entry for each content_type, referencing one another, e.g.
    For Content Type A:
- Content Type A Entry 1:
  _slug: content_type_a_entry_1
  name: Content Type A Entry 1
  content_type_bs:
  - content_type_b_entry_1

For Content Type B:

- Content Type B Entry 1:
  _slug: content_type_b_entry_1
  name: Content Type B Entry 1
  content_type_as:
  - content_type_a_entry_1
  1. Run wagon deploy [env] -d -v

If you have set required: true on both Content Types, you should receive the following error:

persisting Content Type A Entry 1 [failed]
Resource invalid: content_type_a must have at least one element

If you have set required: true on only Content Type B, it will deploy Content Type A Entry 1 without issue, but you should receive the following error:

persisting Content Type B Entry 1 [failed]
Resource invalid: content_type_b must have at least one element

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

No branches or pull requests

1 participant