Power Classes not loading automatically #1004
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1004
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Created some classes in Powers area, then used it in controller with Super___##########################___power.
Expected result
To be able to use the created classes in my component
Actual result
the folders are created correctly in libraries/jcb_powers
The autoloader appears to have been created correctly in helper class:
the Class implementation in the controller shows correctly:
header includes :
use Ambaremma\Ocularix\Component\Order;
but I get this error:
0 Class "Ambaremma\Ocularix\Component\Order" not found
System information (as much as possible)
Additional comments
I understand there is another method for loading classes via plugin, yet I cannot find such template to use, any guidance is appreciated.
Can you test the beta release to see if this issue persist?
https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip
O, yes and please use
PHP 8.0
as Joomla 3.10.12 is known not to work well onPHP 8.1
where 8.0 gives warnings, 8.1 has many depreciation errors.Thank you Llewellyn,
I changed to php 8.0 and installed the beta package you linked. But now I am getting this error during compile:
Error
Ocurrió un error.
0 Object of class stdClass could not be converted to string
/home/ambare5/dev/administrator/components/com_componentbuilder/helpers/compiler/e_Interpretation.php:12317
Call stack
Function Location
1 () JROOT/administrator/components/com_componentbuilder/helpers/compiler/e_Interpretation.php:12317
2 Interpretation->getTabLayoutFieldsArray() JROOT/administrator/components/com_componentbuilder/helpers/compiler/f_Infusion.php:558
3 Infusion->buildFileContent() JROOT/administrator/components/com_componentbuilder/helpers/compiler/f_Infusion.php:62
4 Infusion->__construct() JROOT/administrator/components/com_componentbuilder/helpers/compiler.php:85
5 Compiler->__construct() JROOT/administrator/components/com_componentbuilder/models/compiler.php:146
6 ComponentbuilderModelCompiler->builder() JROOT/administrator/components/com_componentbuilder/controllers/compiler.php:98
7 ComponentbuilderControllerCompiler->compiler() JROOT/libraries/src/MVC/Controller/BaseController.php:702
8 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_componentbuilder/componentbuilder.php:93
9 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
10 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
12 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
13 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:225
14 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51
I was not getting this error previous the intall of he beta package, What can I do here?
This is the method being called:
This line:
is on line 12317 and the
$field
value seems to be an object. Can youvar_dump($field)
this field value if you see its an object? something like this:Then give me the Output... further more we are not seeing this error on our side. To fix this should be easy, but why this happens is the bigger question I would like to answer. Thanks!
Hello, performing the requested action, i get this
object(stdClass)#1157 (3) { ["1"]=> string(5) "phone" ["3"]=> string(8) "caddress" ["2"]=> string(5) "email" }
Field 1157 contains this:
it is a list field, saving as tinyint (1)
I have opened it in edit view in JCB but I canot find anything out of place, I have saved it again but the error persists.
I "solved" it for now adding:
but I would like to know how to avoid it happening again when I update JCB
Can you give me a screenshot of the field? that looks like this:
by the way I can't see how this has anything to do with
Power Classes not loading automatically
indeed, I sidestepped from your first answer, Should I move this conversation to a new thread?
Moving to PHP 8.0 and installing the beta version of JCB generated the error we are following, once fixed, it seems to have fixed the problem on loading the classes from powers.
We can stay in this thread.. your image does not agree with the error your having so are you sure this is the field causing the issue. You should look for a field where the name has
"phone", "caddress", "email"
as values in it. Since this is what you said you get when youvar_dump
the object.That value in
$field
is absolutely not thetipopersonal
field, so you should look for another field in your extension with the"phone", "caddress", "email"
values in it.Curious thing is, I have no field with those values, caddress is a subform, phone and email are text and they are together in a lot of my views, not as a subform, but as independent fields.
I listed that field as its Id is 1157 as the object ID in the error
object(stdClass)#1157 (3) { ["1"]=> string(5) "phone" ["3"]=> string(8) "caddress" ["2"]=> string(5) "email"
in fact, letting it run, meaning not exiting after var dump, using
I get
object(stdClass)#1343 (3) { ["1"]=> string(5) "phone" ["3"]=> string(8) "caddress" ["2"]=> string(5) "email" } object(stdClass)#2618 (1) { ["5"]=> string(4) "nota" } object(stdClass)#2621 (2) { ["2"]=> string(2) "pe" ["1"]=> string(7) "note_pe" } object(stdClass)#2611 (2) { ["1"]=> string(8) "sucursal" ["2"]=> string(6) "codsuc" } object(stdClass)#2646 (11) { ["1"]=> string(3) "rol" ["5"]=> string(4) "extr" ["4"]=> string(13) "tipo_contrato" ["10"]=> string(6) "discap" ["6"]=> string(8) "nacional" ["8"]=> string(2) "tj" ["7"]=> string(2) "je" ["9"]=> string(5) "migra" ["-999"]=> string(8) "sucursal" ["2"]=> string(5) "cargo" ["3"]=> string(8) "contrato" } object(stdClass)#2650 (7) { ["3"]=> string(8) "horasmes" ["5"]=> string(6) "prueba" ["1"]=> string(6) "finlab" ["-999"]=> string(6) "inilab" ["2"]=> string(8) "tipo_jor" ["4"]=> string(12) "salario_base" ["6"]=> string(9) "confianza" } object(stdClass)#2648 (7) { ["2"]=> string(6) "custid" ["5"]=> string(12) "mobile_phone" ["4"]=> string(5) "phone" ["9"]=> string(6) "proreg" ["8"]=> string(11) "dateofbirth" ["6"]=> string(5) "email" ["1"]=> string(6) "idtype" } object(stdClass)#2657 (2) { ["7"]=> string(4) "foto" ["-999"]=> string(8) "caddress" } object(stdClass)#1384 (3) { ["1"]=> string(6) "nombre" ["2"]=> string(8) "apellido" ["3"]=> string(4) "user" } The was successfully compiled.
And what I am able to tell, is that these objects contain a group of fields that belong to the same position in a view.
I hope this helps clear why is this happening.
What I will do is introduce a new registry class that will better manage the dynamic data volumes. I'll be adding it to the beta releases soon and will then bump this thread to let you know. I believe this will resolve our issue and also enhance the stability of the application. The Joomla registry seems too complex for our use case.
We have just updated the beta channel with the fix... let me know if it resolves the issue.
Indeed, totally fixed on my end, thank you!