nenad-zivkovic/yii2-advanced-template

column name 'Item Name' in user/update

Closed this issue · 4 comments

in user/update, the "item_name" column (reads 'Item Name') is not translated to "Role" as on user/view page.

I see in models/User.php there's a method attributeLabels() that translate 'item_name' to 'Role'

Why is user/view using it but not user/update page?

http://prntscr.com/6ge1w9

It says Role. I don't understand your question ?

logged in as superadmin (theCreator), updating another user (editor). It says "Item Name" ?
http://prntscr.com/6gfh89

Adding the following to common/rbac/models/Role.php resolves the issue for the Create & Update forms. (displays "Role" instead of "item_name").

    /**
     * Returns the attribute labels.
     *
     * @return array
     */
    public function attributeLabels()
    {
        return [
            'item_name' => Yii::t('app', 'Role'),
        ];
    }

Thank you. Sorry for no response, I was very busy, but I will add this fix in the next release.