contao-community-alliance / meta-palettes

Dynamic configured palettes for contao.
6 stars 8 forks source link

Fix recursive subpalettes #24

Closed discordier closed 10 years ago

discordier commented 10 years ago

This PR fixes a bug for recursive subpalettes with anonymous legends. The following worked just fine:

            'metapalettes' => array(
                'default' => array(
                    'legend1' => array('field_one', 'field_two'),
                )
            ),
            'metasubselectpalettes' => array(
                'field_two' => array(
                    'value1' => array(
                        'legend1' => 'field_three',
                    )
                ),
                'field_three' => array(
                    'value2' => array(
                        'legend1' => 'field_four'
                    )
                ),
            )

While this did not:

            'metapalettes' => array(
                'default' => array(
                    'legend1' => array('field_one', 'field_two'),
                )
            ),
            'metasubselectpalettes' => array(
                'field_two' => array(
                    'value1' => array(
                        'field_three',
                    )
                ),
                'field_three' => array(
                    'value2' => array(
                        'field_four'
                    )
                ),
            )

Note the absence of the legend naming for the dependant fields. Property field_four was not added at all.

While I was at it, I also fixed the current test cases to reflect the latest changes in DCG and also updated the build dependencies to c-c-a/dc-general 2.0.