User tests: Successful: Unsuccessful:
Bugs: preg_match('/(.*)Controller/i', 'MycomponentControllerMyname', $r);
$this->name = strtolower($r[2]); // mycomponent (instead of myname)
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
@rdeutz If you have a controller has extended on JControllerAdmin and you do not provide a method getModel() then you will get some bugs during execute some task such as publish, ubpublish...
P/s: Sometime we have to create a dynamic controller and we will want to auto detect the name.
So then the solution is to create a getModel Method and not to change the behaviour of the JController.
A good sign that you are making something wrong is when unit tests fail.
Closing it because it isn't a bug
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-09-16 10:42:17 |
Closed_By | ⇒ | rdeutz |
Be careful with this change. While the method name is getName(), it is actually doesn't return name of the controller.
It is used to actually get the name of the component, which then be used as default name of model, default name of view in case there is no data passed to getModel(), getView() method. It is also used for Model class suffix, View class suffix.....
So If we make this change, I am afraid of it will break existing extensions. So although the name of method sound like incorrect, I think we will have to leave it as how it is for now.