-
-
Notifications
You must be signed in to change notification settings - Fork 192
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 #463: added back special case (single PK) #466
Conversation
cjrf
commented
Sep 24, 2021
Q | A |
---|---|
Is bugfix? | yes |
New feature? | no |
Breaks BC? | no |
Tests pass? | yes |
Fixed issues | #463 |
Wouldn't be better to use actual param name here? |
Fixed another way as @WinterSilence suggested. Please check if it works now. |
Still breaks grid/ActionColumn. However, grid/ActionColumn probably shouldn't force "id" as the PK name. |
@cjrf can you post more details? |
For years now, there have been four snippets of code that "rename a single PK to id". So I assume this is a feature. Three of those snippets where in Gii, one in yii/grid/ActionColumn::createUrl. Fix #453 removed just 2/3 of the Gii snippets, breaking the feature and Gii itself. My suggestion (#466) was to simply put those snippets back. Fix #467 removed the third Gii snippet, fixing Gii itself, but not the feature.
By this, I mean that one solution could be to change yii/grid/ActiveColumn and remove completely this renaming feature from Yii2. I advise against this, since it will break back compatibility. |
@cjrf ok, now I'm understand you, but rollback does not solve current problem - primary key can consist of several columns. We need further proceedings. If you have any ideas how fix it without BC, then please post it in new issue. |
@cjrf We can generate I'm still not sure if it is worth the trouble. It should be much simpler to just revert #467 and apply this PR instead. Also, using @WinterSilence I don't think that any of recent changes affected composite private keys. |
@WinterSilence Did you actually tested that this problem exists if you revert #467 and apply #466? Or this is just your speculations? |
@rob006 wrong link, I mean https://github.com/yiisoft/yii2-gii/blob/master/src/generators/crud/default/views/index.php#L36 |
The current implementation of ActionColumn does support composite primary keys (at least to the extent I've tested). In that case, no renaming takes place.
And you're correct. I wasn't sure but tested it and confirmed ActionColumn does support composite primary keys as it is.
Exactly. That's probably why this renaming feature was added a long time ago. And it's not just |
@rob006 at least something in this world remains unchanged (: |