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
fix incorrect generator of title for crud update view #383
fix incorrect generator of title for crud update view #383
Conversation
bscheshirwork
commented
Oct 24, 2018
•
edited
edited
Q | A |
---|---|
Is bugfix? | yes |
New feature? | no |
Breaks BC? | no |
Tests pass? | yes |
Fixed issues | #382 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a line for changelog.
@bscheshirwork please add a line to CHANGELOG. |
Merged. Thank you! |
This PR seems to bring #328 to life again 😢 . |
@ricpelo $generator->getNameAttribute() must return 'id' in your case? |
Look like incorrect work of $generator->getNameAttribute() without 'name' attribute |
@bscheshirwork Just tested, and my PR #387 works OK on every case, with & without 'name' attribute, and with & without i18n. These are the generated code on every case: With 'name' attribute, no i18n:$this->title = 'Update Generos: ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Generos', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update'; With 'name' attribute and i18n:$this->title = Yii::t('app', 'Update Generos: {name}', [
'name' => '' . $model->name,
]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Generos'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); Without 'name' attribute, no i18n:$this->title = 'Update Generos: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Generos', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update'; Without 'name' attribute, with i18n:$this->title = Yii::t('app', 'Update Generos: {name}', [
'name' => '' . $model->id,
]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Generos'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); |
I've updated PR #387 to avoid unnecessary With 'name' attribute, no i18n:$this->title = 'Update Generos: ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Generos', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update'; With 'name' attribute and i18n:$this->title = Yii::t('app', 'Update Generos: {name}', [
'name' => $model->name,
]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Generos'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); Without 'name' attribute, no i18n:$this->title = 'Update Generos: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Generos', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update'; Without 'name' attribute, with i18n:$this->title = Yii::t('app', 'Update Generos: {name}', [
'name' => $model->id,
]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Generos'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); |
@bscheshirwork
The problem is in bad usage of the |