Skip to content

Correctly set the field and inputName attributes when creating DC#220

Merged
davidmaack merged 1 commit into
menatwork:masterfrom
aschempp:master
Oct 3, 2017
Merged

Correctly set the field and inputName attributes when creating DC#220
davidmaack merged 1 commit into
menatwork:masterfrom
aschempp:master

Conversation

@aschempp

Copy link
Copy Markdown
Contributor

The attribute inputName is actually wrong, as it is only a getter and not a setter in DataContainer (see https://github.com/contao/core-bundle/blob/master/src/Resources/contao/classes/DataContainer.php#L55). The value of the field can only be set by calling the actual variable name, as the setter allows for that.

Secondly, the inputField variable is intended to define the widget name without affecting the DCA field name. Therefore $dc->field should be set to the actual field, while inputName should be set to the generated name. DC_Table does the same in edit-multiple mode.

This also fixes compatibility with the new dcaPicker in Contao 4.4

@stefanheimes stefanheimes self-requested a review July 6, 2017 13:30
@stefanheimes stefanheimes self-assigned this Jul 6, 2017
@davidmaack davidmaack merged commit 3ae3667 into menatwork:master Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants