I added the Joomla Power: Factory inside my own power. When i compiled it. It did not add the use statement to the top of the file rather inside the class tag.
Steps to reproduce the Bug
create new power and add a Joomla SPK inside the function you create.
Expect the use statement to be added to top of the file.
Result:
<?php
/**
* @package [[[Component]]]
*
* @created 15th juni, 2025
* @author Tom van der Laan <https://www.tlwebdesign.nl>
* @copyright Copyright (C) 2025. All Rights Reserved
* @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
*
* [[[Component]]] urenregistratie
*/
namespace [[[Component]]]\Joomla;
/**
* Helper class for various functions throughout the application
*/
class Helpers
{
/***[JCBGUI.power.main_class_code.922.$$$$]***/use Joomla\CMS\Factory;
public static function getVuser($userId) {
$db = Factory::getContainer()->get('DatabaseDriver');
The code inside the gui was:
public static function getVuser($userId) {
$db = Joomla___39403062_84fb_46e0_bac4_0023f766e827___Power::getContainer()->get('DatabaseDriver');
Which Joomla version are you compiling in?
5.3.2
Which PHP version are you compiling in?
8.3
Which Joomla versions are you targeting?
5
Which PHP version are you targeting?
8.3
Which Web server is JCB running on?
Litespeed
Which Relational Database is JCB running on?
MariaDB 11.4
Which OS is JCB running on?
Almalinux
Which JCB version are you using?
5.1.1 stable
Where in JCB did this issue occur?
Compilation of a component
On which browsers did you encounter the issue?
Firefox
Additional Comments
No response
### What Happened?
I added the Joomla Power: Factory inside my own power. When i compiled it. It did not add the use statement to the top of the file rather inside the class tag.
### Steps to reproduce the Bug
create new power and add a Joomla SPK inside the function you create.
Expect the use statement to be added to top of the file.
Result:
```
<?php
/**
* @package [[[Component]]]
*
* @created 15th juni, 2025
* @author Tom van der Laan <https://www.tlwebdesign.nl>
* @copyright Copyright (C) 2025. All Rights Reserved
* @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
*
* [[[Component]]] urenregistratie
*/
namespace [[[Component]]]\Joomla;
/**
* Helper class for various functions throughout the application
*/
class Helpers
{
/***[JCBGUI.power.main_class_code.922.$$$$]***/use Joomla\CMS\Factory;
public static function getVuser($userId) {
$db = Factory::getContainer()->get('DatabaseDriver');
```
The code inside the gui was:
```
public static function getVuser($userId) {
$db = Joomla___39403062_84fb_46e0_bac4_0023f766e827___Power::getContainer()->get('DatabaseDriver');
```
### Which Joomla version are you compiling in?
5.3.2
### Which PHP version are you compiling in?
8.3
### Which Joomla versions are you targeting?
5
### Which PHP version are you targeting?
8.3
### Which Web server is JCB running on?
Litespeed
### Which Relational Database is JCB running on?
MariaDB 11.4
### Which OS is JCB running on?
Almalinux
### Which JCB version are you using?
5.1.1 stable
### Where in JCB did this issue occur?
Compilation of a component
### On which browsers did you encounter the issue?
Firefox
### Additional Comments
_No response_
Joomla Powers is not yet fully functional in the Powers area of JCB. You will still need to add it manually. We have a project where we want to add a use selection like we have with the other powers but this is not yet ready.
Joomla Powers is **not yet fully functional** in the Powers area of JCB. You will still need to add it manually. We have a project where we want to add a use selection like we have with the other powers but this is not yet ready.
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?
I added the Joomla Power: Factory inside my own power. When i compiled it. It did not add the use statement to the top of the file rather inside the class tag.
Steps to reproduce the Bug
create new power and add a Joomla SPK inside the function you create.
Expect the use statement to be added to top of the file.
Result:
The code inside the gui was:
Which Joomla version are you compiling in?
5.3.2
Which PHP version are you compiling in?
8.3
Which Joomla versions are you targeting?
5
Which PHP version are you targeting?
8.3
Which Web server is JCB running on?
Litespeed
Which Relational Database is JCB running on?
MariaDB 11.4
Which OS is JCB running on?
Almalinux
Which JCB version are you using?
5.1.1 stable
Where in JCB did this issue occur?
Compilation of a component
On which browsers did you encounter the issue?
Firefox
Additional Comments
No response
Joomla Powers is not yet fully functional in the Powers area of JCB. You will still need to add it manually. We have a project where we want to add a use selection like we have with the other powers but this is not yet ready.