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

Table fieldtypes default to 1 existing row when created leading to blank output #18

Closed
angrybrad opened this issue Jan 29, 2017 · 2 comments
Labels
enhancement improvements to existing features severity:minor Cosmetic issues or bugs with simple workarounds

Comments

@angrybrad
Copy link
Member

Environment:

  • Craft version: 3.x
  • PHP version: 7.x
  • Database driver & version:
  • Plugins & versions:

Description:

When creating a new table field it defaults to already having one empty row unfilled. If left in the default state and the user leaves this field blank while creating an entry then the template may output blank content without extra logical checks to empty cell-values within the template.

It is possible to delete the default blank row 'placeholder' when creating the field, however this behavior seems different from the default of other fields which fallback to a 'null' state when left blank.

I see the argument here that adding the first row to a table may be non-obvious to the user, but the default state seems just as confusing.

@tjdraper
Copy link

tjdraper commented Feb 9, 2018

Adding here that it's not just happening when creating a new table field. At least on Matrix, a single empty row of default values is created anytime the Matrix field is revisited and re-saved, which is extremely frustrating when you have to remember to delete that empty default values row for every table in the Matrix field that isn't supposed to have default values.

@brandonkelly
Copy link
Member

Table fields will only create a default row if their Default Value field setting has a row. If you don’t like that behavior, you can delete the default row in the setting.

@tjdraper The only time a Matrix field should be creating any blocks automatically is if the Min Blocks setting is set (new in Craft 3), and there’s only one available block type. If it’s happening in other situations for you, please post as a new issue with specific steps to reproduce - including your Craft version number. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features severity:minor Cosmetic issues or bugs with simple workarounds
Projects
None yet
Development

No branches or pull requests

3 participants