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

No bidirectional relations when one of the contenttypes is a singleton. #3394

Open
evertalbers opened this issue Jan 23, 2023 · 0 comments
Open

Comments

@evertalbers
Copy link

evertalbers commented Jan 23, 2023

I notice that Bolt errors when trying to make relations between a singleton and a normal contenttype.

You should be able to reproduce this with the shortened contenttypes below. (You don't need a working frontend as this bug happens in the backend).

The code below works, to see the error set the homepage to singleton: true, open an edition and make a relation to the homepage and you should see it.
I did not see a difference between multiple: true and multiple: false.

Tested on php7.x & php8.0, Bolt5.1.18 & 5.1.20

homepages:
    name: Homepages
    singular_name: Homepage
    fields:
        title:
            type: text
            class: large
            group: content
            label: Title
        image:
            type: image
        introduction:
            type: redactor
        content:
            type: redactor
        slug:
            type: slug
            uses: title
            group: Meta
            prefix: The homepage with slug 'homepage' will be used as actual homepage.
    viewless: false
    relations: 
        editions:
            label: 'Select the edition(s) to be shown on the homepage'
            # postfix: It is not recommended to show more than 1 but it works, technically
            multiple: true
            required: false
    locales: ['en']
    singleton: false
    icon_many: "fa:home"
    icon_one: "fa:home"

editions:
    name: Editions
    singular_name: Edition
    fields:
        title:
            type: text
            class: large
        slug:
            type: slug
            uses: title
            group: Meta
    relations: 
        speakers:
            label: Select related speakers
            multiple: true
            required: false
        homepages:
            label: Select related homepage
            # prefix: This will make this item appear on top of the homepage
            multiple: false
            required: false
            order: -id
    records_per_page: 50
    order: id

speakers:
    name: Speakers
    singular_name: Speaker
    title_format: "{name} ({description})"
    fields:
        name:
            type: text
            class: large
            variant: inline
            fixture_format: '{name}'
        slug:
            type: slug
            uses: [ name ]
    relations: 
        editions:
            label: Select related editions
            multiple: true
            required: false
    icon_one: fa:user
    icon_many: fa:users
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