Error compiling plugin linked to a component #1023

Closed
opened 2023-12-20 10:22:55 +00:00 by Tom van der Laan · 5 comments

Steps to reproduce the issue

Compile a component with a plugin attached to it

Expected result

compile succesfull.

Actual result

Error:

Argument 1 passed to VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure::setMainXmlFile() must be an instance of VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\mixed, instance of stdClass given, called in /root/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php on line 196
/root/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php:328

Terug naar controlepaneel

Call stack
#	Function	Location
1	()	JROOT/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php:328
2	VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure->setMainXmlFile()	JROOT/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php:196
3	VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure->build()	JROOT/administrator/components/com_componentbuilder/helpers/compiler/b_Structure.php:440
4	Structure->__construct()	JROOT/administrator/components/com_componentbuilder/helpers/compiler/e_Interpretation.php:262
5	Interpretation->__construct()	JROOT/administrator/components/com_componentbuilder/helpers/compiler/f_Infusion.php:59
6	Infusion->__construct()	JROOT/administrator/components/com_componentbuilder/helpers/compiler.php:85
7	Compiler->__construct()	JROOT/administrator/components/com_componentbuilder/models/compiler.php:146
8	ComponentbuilderModelCompiler->builder()	JROOT/administrator/components/com_componentbuilder/controllers/compiler.php:98
9	ComponentbuilderControllerCompiler->compiler()	JROOT/libraries/src/MVC/Controller/BaseController.php:702
10	Joomla\CMS\MVC\Controller\BaseController->execute()	JROOT/administrator/components/com_componentbuilder/componentbuilder.php:95
11	require_once()	JROOT/libraries/src/Component/ComponentHelper.php:402
12	Joomla\CMS\Component\ComponentHelper::executeComponent()	JROOT/libraries/src/Component/ComponentHelper.php:377
13	Joomla\CMS\Component\ComponentHelper::renderComponent()	JROOT/libraries/src/Application/AdministratorApplication.php:101
14	Joomla\CMS\Application\AdministratorApplication->dispatch()	JROOT/libraries/src/Application/AdministratorApplication.php:159
15	Joomla\CMS\Application\AdministratorApplication->doExecute()	JROOT/libraries/src/Application/CMSApplication.php:225
16	Joomla\CMS\Application\CMSApplication->execute()	JROOT/administrator/index.php:51

System information (as much as possible)

  • OS Name & Version: Mac OS
  • MySql Version: 10.4.x MariaDB
  • Apache Version: 2.x
  • PHP Version: 7.4
  • Joomla Version: 3.10.12
  • JCB Version: 3.1.28
  • Browser: Safari

Additional comments

I get this error after i updated a JCB instance from version 2.3 to the latest stable release. Then i tried to compile a component again.

### Steps to reproduce the issue Compile a component with a plugin attached to it ### Expected result compile succesfull. ### Actual result Error: ``` Argument 1 passed to VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure::setMainXmlFile() must be an instance of VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\mixed, instance of stdClass given, called in /root/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php on line 196 /root/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php:328 Terug naar controlepaneel Call stack # Function Location 1 () JROOT/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php:328 2 VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure->setMainXmlFile() JROOT/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php:196 3 VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure->build() JROOT/administrator/components/com_componentbuilder/helpers/compiler/b_Structure.php:440 4 Structure->__construct() JROOT/administrator/components/com_componentbuilder/helpers/compiler/e_Interpretation.php:262 5 Interpretation->__construct() JROOT/administrator/components/com_componentbuilder/helpers/compiler/f_Infusion.php:59 6 Infusion->__construct() JROOT/administrator/components/com_componentbuilder/helpers/compiler.php:85 7 Compiler->__construct() JROOT/administrator/components/com_componentbuilder/models/compiler.php:146 8 ComponentbuilderModelCompiler->builder() JROOT/administrator/components/com_componentbuilder/controllers/compiler.php:98 9 ComponentbuilderControllerCompiler->compiler() JROOT/libraries/src/MVC/Controller/BaseController.php:702 10 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_componentbuilder/componentbuilder.php:95 11 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402 12 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377 13 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101 14 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159 15 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:225 16 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51 ``` ### System information (as much as possible) - OS Name & Version: Mac OS - MySql Version: 10.4.x MariaDB - Apache Version: 2.x - PHP Version: 7.4 - Joomla Version: 3.10.12 - JCB Version: 3.1.28 - Browser: Safari ### Additional comments I get this error after i updated a JCB instance from version 2.3 to the latest stable release. Then i tried to compile a component again.
Owner

Hi Tom, I am in the middle of major moves towards the J4 build target, and can help with this right away. If you could debug this a little more, and see if you can fix this it will really help me.

I want to get JCB 3.2 (in Joomla 3) out that can build Joomla 4/5 extensions. You will see that we already have nearly all namespace for all J[ClassName] in place when you take a look at the last update to getBible. Which means we are almost there...

I will bump out a Beta soon.

Hi Tom, I am in the middle of major moves towards the J4 build target, and can help with this right away. If you could debug this a little more, and see if you can fix this it will really help me. I want to get JCB 3.2 (in Joomla 3) out that can build Joomla 4/5 extensions. You will see that we already have nearly all namespace for all J[ClassName] in place when you take a look at the last update to [getBible](https://git.vdm.dev/getBible/joomla-component/commit/8d583feb3f9bfdee36ecbd8268a0929e35aa8241). Which means we are almost there... I will bump out a Beta soon.

hi,
Looking at the code in setMainXmlFile() I notice that the function works with an object, so I removed the "mixed" type from the function declaration and now it works.

\libraries\jcb_powers\VDM.Joomla\src\Componentbuilder\Compiler\Joomlaplugin\Structure.php

protected function setMainXmlFile(mixed $plugin): void
	{...}

Change it to this

protected function setMainXmlFile($plugin): void
	{...}
hi, Looking at the code in setMainXmlFile() I notice that the function works with an object, so I removed the "mixed" type from the function declaration and now it works. \libraries\jcb_powers\VDM.Joomla\src\Componentbuilder\Compiler\Joomlaplugin\Structure.php ``` protected function setMainXmlFile(mixed $plugin): void {...} ``` Change it to this ``` protected function setMainXmlFile($plugin): void {...} ```
Owner

We fixed this in the last beta release, as this issue was mentioned by @vistamedia in #1045

We fixed this in the last beta release, as this issue was mentioned by @vistamedia in #1045

I had the previous version of JCB and when I encountered the problem for the first time, I tried to solve it and posted my solution, then I saw that it was already solved. 😅

I had the previous version of JCB and when I encountered the problem for the first time, I tried to solve it and posted my solution, then I saw that it was already solved. 😅
Owner

I will then close this issue, should it come up again, you can either bump this issue or open a new one.

I will then close this issue, should it come up again, you can either bump this issue or open a new one.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1023
No description provided.