Controller.php doesn't have the use Joomla\CMS\MVC\Controller\FormController; at the top of the file, so I get an error when I try to call a custom method.
To fix the error:
add the use statement at the top of the file
change the postSaveHook signature. The correct one should be:
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param \Joomla\CMS\MVC\Model\BaseDatabaseModel $model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 12.2
*/
protected function postSaveHook(\Joomla\CMS\MVC\Model\BaseDatabaseModel $model, $validData = [])
{
}
Steps to reproduce the Bug
Create a component with a site view
Which Joomla version are you compiling in?
3.10.12
Which PHP version are you compiling in?
8.2.2
Which Joomla versions are you targeting?
4.4.4
Which PHP version are you targeting?
8.2.4
Which Web server is JCB running on?
Apache 2.4
Which Relational Database is JCB running on?
MySql 8.0
Which OS is JCB running on?
Windows 11
Which JCB version are you using?
3.2.1-rc4
Where in JCB did this issue occur?
Compilation of a component, Site View(admin_view)
On which browsers did you encounter the issue?
Firefox, Chrome
Additional Comments
No response
### What Happened?
<Single view name>Controller.php doesn't have the use Joomla\CMS\MVC\Controller\FormController; at the top of the file, so I get an error when I try to call a custom method.
To fix the error:
1) add the use statement at the top of the file
2) change the postSaveHook signature. The correct one should be:
```
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param \Joomla\CMS\MVC\Model\BaseDatabaseModel $model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 12.2
*/
protected function postSaveHook(\Joomla\CMS\MVC\Model\BaseDatabaseModel $model, $validData = [])
{
}
```
### Steps to reproduce the Bug
Create a component with a site view
### Which Joomla version are you compiling in?
3.10.12
### Which PHP version are you compiling in?
8.2.2
### Which Joomla versions are you targeting?
4.4.4
### Which PHP version are you targeting?
8.2.4
### Which Web server is JCB running on?
Apache 2.4
### Which Relational Database is JCB running on?
MySql 8.0
### Which OS is JCB running on?
Windows 11
### Which JCB version are you using?
3.2.1-rc4
### Where in JCB did this issue occur?
Compilation of a component, Site View(admin_view)
### On which browsers did you encounter the issue?
Firefox, Chrome
### Additional Comments
_No response_
Polmock
added the Bug label 2024-05-02 16:00:56 +00:00
What's strange is that I see that in the compiler folder, the template seems ok, but when I re-compile my component, I still see the issue... Maybe there is some cache somewhere? What can I do to force the refresh? I've already manually replaced the files in the compiler folder...
I still have the issue in 3.2.2-alpha1.
What's strange is that I see that in the compiler folder, the template seems ok, but when I re-compile my component, I still see the issue... Maybe there is some cache somewhere? What can I do to force the refresh? I've already manually replaced the files in the compiler folder...
We have verified that the current JCB compiler correctly generates the required controller imports and the postSaveHook() method signature.
Both reported problems have been addressed in newer JCB versions.
Since this issue has been resolved, we will be closing it.
We have verified that the current JCB compiler correctly generates the required controller imports and the `postSaveHook()` method signature.
Both reported problems have been addressed in newer JCB versions.
Since this issue has been resolved, we will be closing it.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What Happened?
Controller.php doesn't have the use Joomla\CMS\MVC\Controller\FormController; at the top of the file, so I get an error when I try to call a custom method.
To fix the error:
Steps to reproduce the Bug
Create a component with a site view
Which Joomla version are you compiling in?
3.10.12
Which PHP version are you compiling in?
8.2.2
Which Joomla versions are you targeting?
4.4.4
Which PHP version are you targeting?
8.2.4
Which Web server is JCB running on?
Apache 2.4
Which Relational Database is JCB running on?
MySql 8.0
Which OS is JCB running on?
Windows 11
Which JCB version are you using?
3.2.1-rc4
Where in JCB did this issue occur?
Compilation of a component, Site View(admin_view)
On which browsers did you encounter the issue?
Firefox, Chrome
Additional Comments
No response
In version 3.2.1-rc5 is fixed only the second part of the issue.
Still missing the top file 'use' statement
In version 3.2.1-rc6 the second part of the issue is back again!
I still have the issue in 3.2.2-alpha1.
What's strange is that I see that in the compiler folder, the template seems ok, but when I re-compile my component, I still see the issue... Maybe there is some cache somewhere? What can I do to force the refresh? I've already manually replaced the files in the compiler folder...
We have verified that the current JCB compiler correctly generates the required controller imports and the
postSaveHook()method signature.Both reported problems have been addressed in newer JCB versions.
Since this issue has been resolved, we will be closing it.