Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GRIDFIELD] Two GridFields with Title and Right Title (description) overlap each other in CMS #8253

Closed
sunnysideup opened this issue Jul 10, 2018 · 3 comments

Comments

@sunnysideup
Copy link
Contributor

Affected Version

SS 4.1.1

Description

Grid Fields overlap each other

image

Steps to Reproduce

  1. create DataObject

  2. add the following fields and CMS Fields:

    private static $many_many = [
        'LinkA' => Page::class,
        'LinkB' => Page::class
    ];


    public function fieldLabels($includerelations = true)
    {
        $labels = parent::fieldLabels($includerelations);
        $labels['LinkA'] = _t(__CLASS__ . '.LinkA', 'Ignore on ...');
        $labels['LinkB'] = _t(__CLASS__ . '.LinkB', 'Always Show On ...');

        return $labels;
    }

    public function fieldLabelsRight($includerelations = true)
    {
        $labels = [];
        $labels['LinkA'] = _t(__CLASS__ . '.LinkA_RIGHT', 'Do not show on the following pages.');
        $labels['LinkB'] = _t(__CLASS__ . '.LinkB_RIGHT', 'Always show on the following pages');

        return $labels;
    }

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $rightFieldDescriptions = $this->fieldLabelsRight();
        foreach($rightFieldDescriptions as $field => $desc) {
           $formField = $fields->DataFieldByName($field);
           if($formField) {
               $formField->setDescription($desc);
           }
        }

        $fields->addFieldsToTab(
            'Root.PageExceptions',
            [
                $fields->dataFieldByName('LinkA'),
                $fields->dataFieldByName('LinkB')
            ]
        );
        return $fields;
    }

@dhensby
Copy link
Contributor

dhensby commented Jul 11, 2018

This should probably be reported in silverstripe/cms and not framework

@sminnee sminnee changed the title Two GridFields with Title and Right Title (description) overlap each other in CMS [GRIDFIELD] Two GridFields with Title and Right Title (description) overlap each other in CMS Oct 7, 2018
@sabina-talipova
Copy link
Contributor

sabina-talipova commented Jun 22, 2022

Related to:

@sabina-talipova
Copy link
Contributor

It look like this issue was resolved by other bug fixing task. Close this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants