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

console action "actionS" runs twice #17568

Closed
oleyur opened this issue Sep 24, 2019 · 9 comments
Closed

console action "actionS" runs twice #17568

oleyur opened this issue Sep 24, 2019 · 9 comments
Labels
expired Information requested was not provided in two weeks. type:docs Documentation

Comments

@oleyur
Copy link

oleyur commented Sep 24, 2019

What steps will reproduce the problem?

run actionS(){} as console action

What is the expected result?

runs twice

What do you get instead?

not using this action name in app

Additional info

\yii\base\Controller::createAction
_protected/vendor/yiisoft/yii2/base/Controller.php:223

$actionMap = $this->actions();

Q A
Yii version 2.0.11.2.
PHP version 7.0.33
Operating system
@oleyur oleyur changed the title console command actionS runs twice console action "actionS" runs twice Sep 24, 2019
@rob006
Copy link
Contributor

rob006 commented Sep 24, 2019

actions() is reserved method name, you can't have actionS() as action method name. The only way to have action s is to define it inside of actions() as a standalone action class.

@oleyur
Copy link
Author

oleyur commented Sep 24, 2019

actions() is reserved method name, you can't have actionS() as action method name. The only way to have action s is to define it inside of actions() as a standalone action class.

Sure, but I did not find mention of this in the documentation

@kamarton
Copy link
Contributor

@rob006 I don't really understand the relationship between the actions and actionS method names since they can be used separately as a method.

This seems more like a mistake, but if not, it's really missing from the documentation.

@rob006
Copy link
Contributor

rob006 commented Sep 24, 2019

@rob006 I don't really understand the relationship between the actions and actionS method names since they can be used separately as a method.

No, they don't. In PHP methods names are case insensitive, so there is no difference between actions(), actionS() or aCtIoNs() - they're the same method and you can have only one of them. Since actions() is already part of the Controller interface and should return actions list, you can't use it as action handler.

@rob006 rob006 added the type:docs Documentation label Sep 24, 2019
@samdark samdark closed this as completed Oct 1, 2019
@samdark samdark reopened this Oct 1, 2019
@samdark
Copy link
Member

samdark commented Oct 1, 2019

I don't think there is a good way to mention it.

@samdark
Copy link
Member

samdark commented Oct 1, 2019

@rob006 any suggestion?

@rob006
Copy link
Contributor

rob006 commented Oct 1, 2019

@samdark
Copy link
Member

samdark commented Oct 1, 2019

@oleyur would you please provide exact code on how you are defining your action?

@yiisoft yiisoft deleted a comment from yii-bot Oct 1, 2019
@samdark samdark added expired Information requested was not provided in two weeks. and removed status:need more info labels Nov 5, 2019
@yii-bot
Copy link

yii-bot commented Nov 5, 2019

It has been 2 or more weeks with no response on our request for more information.
In order for our issue tracker to be effective, we are closing this issue.

If you want it to be reopened again, feel free to supply us with the requested information.

Thanks!

This is an automated comment, triggered by adding the label expired.

@yii-bot yii-bot closed this as completed Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expired Information requested was not provided in two weeks. type:docs Documentation
Projects
None yet
Development

No branches or pull requests

5 participants