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

Saving fieldset in CP that uses a Bard field without 'sets' causes error #1962

Closed
jamiedumont opened this Issue May 24, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@jamiedumont

jamiedumont commented May 24, 2018

Describe the bug
When a Bard field is configured without sets, the collection and fieldset can be loaded in the Control Panel. However, when the fieldset is saved, the CP adds sets: null to the field, which causes the error on the fieldset config page, and in the any collections using the fieldset.

To Reproduce
Steps to reproduce the behavior:

  1. Create a fieldset that uses a Bard field, without any sets defined using the editor.
  2. Create a collection using that fieldset
  3. At this stage, everything should work.
  4. Now open the fieldset config in the CP. Change nothing and save it. The fieldset in your editor should now have sets: null added.
  5. Reloading the fieldset config, or adding an entry to the associated collection causes a "foreach()" error.

Expected behavior
The CP save doesn't add sets: null to the fieldset.

Environment details (please complete the following information):

  • Statamic Version: 2.9.2
  • Upgrade:
  • OS: macOS 10.13.4
  • Browser: Safari
  • Web Server: Valet
  • PHP Version: 7.1
  • Addons installed: Charge, Spock, PowerTools
@Krzemo

This comment has been minimized.

Krzemo commented May 27, 2018

adding sets: null manually doesnt fix it. Adding sets: [] does.

@edalzell

This comment has been minimized.

edalzell commented May 28, 2018

I think this is fixed in the recent version, 2.9.4

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented May 31, 2018

Duplicate of #1955

@jasonvarga jasonvarga marked this as a duplicate of #1955 May 31, 2018

@jasonvarga jasonvarga closed this Jun 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment