contao-community-alliance / dc-general

Universal data container for Contao!
https://dc-general.readthedocs.io/de/latest/
GNU Lesser General Public License v3.0
16 stars 21 forks source link

DCG ignores doNotSaveEmpty #385

Open dmolineus opened 7 years ago

dmolineus commented 7 years ago

Checklist before I submit this issue report

I confirm that:

My environment is:

(Please fill in the actual values from your environment)

Key Value Comments
PHP version: 7.1
Contao version: 4.4
DC_General version: feature/contao4
Installation via composer: yes

Issue description

I stumbled upon the issue that a wrong default value is used (MM 2.1 context) and the DB saving failed. I had a closer look, the field should actually not be saved when being empty (doNotSaveEmpty). I checked the source code of the DCG, there is not checking of the flag in the DCG at all.

I think it should be added to the DefaultDataProvider. But the definition is not available there. Any ideas how to solve it @baumannsven @discordier?

discordier commented 6 years ago

Should be fixed in f2589769bff2ad82ef2d7aed127451a693b254ee or not?

discordier commented 6 years ago

Probably dupe of #383

zonky2 commented 6 years ago

@discordier was hat # 383 mit doNotSaveEmpty zu tun?

dmolineus commented 6 years ago

Should be fixed in f258976 or not?

Unfortunately not. The extra param doNotSaveEmpty is simply not handled anywhere in DCG. Afaik it wasn't available in Contao when DCG was intial created. So I guess that's why it's missing at the moment.

discordier commented 6 years ago

@zonky2 sorry, I mixed up alwaysSave and doNotSaveEmpty

baumannsven commented 6 years ago

@zonky2 Can you test this. I mean is so good.

zonky2 commented 2 years ago

Zum Beispiel für Passwortfeld oder ein Feld, was nie leer werden darf...