Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#384: Default values for new field

When you append new field to the section with existing entries, default value is not appended to thees entries.

Sample: 1. Create Section 2. Create Entries for this Section 3. Modify Section, add checkbox field 4. Create DataSource with filter over that checkbox field 5. Test it - not filtering

I’m not sure we’d classify this as a bug. We tend to be wary of doing things magically behind users’ backs, and it’s conceivable that there are scenarios in which you add fields to a Section but don’t want existing entries changed. So I’m not convinced that the default behavior should be to update existing entries with a default value…

Anyone else have thoughts on this?

It would be a great optional feature. But I think this should be handled by each field and not by the core.

Automation is nice, but you can set a value for a particular field in all entries of a table quite easily using either phpmyadmin or the mysql command line.

add checkbox field 4. Create DataSource with filter over that checkbox field 5. Test it - not filtering

Perhaps this is a checkbox bug that hasn’t yet been discovered? There used to be a bug whereby if you added a Checkbox field (so all entries would have a “No” state since it’s just been added) and then you filtered in a Data Source for all entries where value is “no” you’d get no results. I thought this had long been fixed.

Sorry for late response - heat & work.

so all entries would have a “No” state since it’s just been added

Yep! That’s what I mean. Obviously, there are some field types with no definite dufault state, and we can’t ask the core to do something with that (i.e.: textfield). But there is no NULL value for Checkbox. Or, for example, may be text field with number validation must be set to 0?

Conserning behavior… I jast add new field. There is no any functionality I broke with any value. And in this particular case I (as web-developer) expect the default value. It is not very clear for me, that I have to enter all entries and just click Save button to init default value )).

I think the issue here is that the JOIN will get all the correct entries (because it’s a LEFT join), but the WHERE clause will throw out all the null values because it’ll be formed to be WHERE t30_1.value = $value.

Try this commit, I think I’ve fixed it.

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details