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

Reorder pick attribute label #14831

Conversation

bscheshirwork
Copy link
Contributor

Add additional check for filter model before get label from dataProvider's model

Q A
Is bugfix? yes
New feature? no
Breaks BC? yes: same named attribute generate label from the filter model, not from the base model
Tests pass? yes/no
Fixed issues #14829

@klimov-paul
Copy link
Member

klimov-paul commented Sep 15, 2017

See explanation at #4738

@bscheshirwork
Copy link
Contributor Author

@klimov-paul, please see different:

get from filterModel only if filterModel is a child model

            /* @var $modelClass Model */
            $modelClass = $provider->query->modelClass;
            if ($this->grid->filterModel !== null && $this->grid->filterModel instanceof $modelClass) {
                return $this->grid->filterModel->getAttributeLabel($this->attribute);
            }
            /* @var $model ActiveRecord */
            $model = $modelClass::instance();

            return $model->getAttributeLabel($this->attribute);

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.

2 participants