madeyourday / contao-rocksolid-custom-elements

RockSolid Custom Elements Contao Extension
http://rocksolidthemes.com/de/contao/plugins/custom-content-elements
MIT License
48 stars 12 forks source link

Field key "exclude" is not working #80

Closed websolutions-hamburg closed 7 years ago

websolutions-hamburg commented 7 years ago

If you use the exclude field key, the field is not visible including the admins.

Contao v4.4.1 & Custom Elements v2.0.3

'fields' => array(
        'type' => array(
            'label' => array('Text', 'Test'),
            'exclude' => true,
            'inputType' => 'text'
        )
)
ausi commented 7 years ago

What do you want to happen if you set 'exclude' => true?

websolutions-hamburg commented 7 years ago

The default defined behavior from Contao. I think this will be great. At the moment it is strange, that the the field is not visible if you set this key to true and you are an admin.

The description from Contao is:

If true the field will be excluded for non-admins. It can be enabled in the user group module (allowed excluded fields).

https://docs.contao.org/books/api/dca/reference.html

ausi commented 7 years ago

This cannot work for custom element fields because all data is stored in the same column rsce_data. This would mean that if a non-admin user saves a custom element, the data of all excluded fields would be lost.

You can work around that by create a “native” field for tl_content with 'exclude' => true and using it in the custom element via 'type' => 'standardField',

websolutions-hamburg commented 7 years ago

Ah ok. Thanks for this information and the workaround tip.