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

[BUG] – Repeaters in Templatefields not allowing you to remove last set #6790

Closed
stueybrock opened this issue Jul 5, 2017 · 4 comments
Closed
Assignees
Milestone

Comments

@stueybrock
Copy link

Details

  • Relevant Bolt Version: [ 3.2.10 ]
  • Install type: [ Composer install ]
  • PHP version: [ 7.0 ]
  • Used web server: [ Apache ]

Reproduction

  1. Bug summary:

    • Upon trying to delete all sets of a repeater, the last one does not get removed upon save.
  2. Specifics:

  3. Steps to reproduce:

Code for the repeater itself:

my_repeater:
            label: My repeater
            type: repeater
            fields:
                name:
                    label: Name
                    type: text
                libk:
                    label: Link
                    error: Please enter a valid URL
                    pattern: url
                    type: text
                logo:
                    label: Logo
                    type: image
  • Add two sets of content into the repeater, then save
  • Remove one of the sets and save, this should work as expected leaving one remaining
  • Remove the remaining set, save, then refresh the page
  • The last remaining set is not getting removed from the repeater

Have tried re-ordering and removing multiple sets at once, with the same result. If multiple items get removed at once (both items one and two are removed at the same time therefore emptying the repeater), upon refresh they will both still be in the repeater.

  1. Expected result:

    • When all items have been removed, no matter whether I delete one or many, this should save in the database and leave an empty repeater.
  2. Actual result:

    • Repeater seems as if it has saved, but upon refresh the final set that was deleted to leave the repeater empty has not been removed.
@rossriley rossriley self-assigned this Jul 5, 2017
@mrenigma
Copy link

mrenigma commented Jul 5, 2017

I'd also like to add that this was specifically tested using a repeater as a template field. This hasn't been tested AFAIK with a repeater as a content type field.

@bobdenotter
Copy link
Member

Please try it out with a "normal" repeater too. "repeaters in templates" are ever so more complex.

@jadwigo
Copy link
Contributor

jadwigo commented Jul 6, 2017

I've noticed that when you create a new record that may have repeaters there will always be at least one repeater.

This looks like there is an "empty repeater" prepared if you have removed the last repeater.

It might be because there are some default values defined in the contenttypes.yml for the repeater fields, but I'm not sure about that yet.

@stueybrock
Copy link
Author

Tested with a "normal" repeater inside contenttypes.yml and the result of removing the final set is that an empty array is produced, which is the expected result.

Therefore it does seem like a "repeaters in templates" issue.

@rossriley rossriley changed the title [BUG] – Repeaters not allowing you to remove last set [BUG] – Repeaters in Templatefields not allowing you to remove last set Jul 8, 2017
@GwendolenLynch GwendolenLynch added this to the Bolt 3.2 - Feature release milestone Jul 9, 2017
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

6 participants