[BUG]: Compiler Error #1228

Closed
opened 2025-06-23 02:30:06 +00:00 by mwweb · 9 comments

What Happened?

When attempting to compile a component, even the Demo component, I am receiving a Fatal Error from the compiler.

Compile Error: Declaration of VDM\Joomla\Componentbuilder\Compiler\Creator\FieldXML::get(string $setType, array &$fieldAttributes, string &$name, string &$typeName, string &$langView, string &$nameSingleCode, string &$nameListCode, array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = ''): stdClass must be compatible with VDM\Joomla\Componentbuilder\Compiler\Interfaces\Creator\Fieldtypeinterface::get(string $setType, array &$fieldAttributes, string $name, string $typeName, string $langView, string $nameSingleCode, string $nameListCode, array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = '')

Steps to reproduce the Bug

Install JCB 5.1.1-beta2 , and compile a component.

Which Joomla version are you compiling in?

5.3.1

Which PHP version are you compiling in?

8.2.24

Which Joomla versions are you targeting?

5.x

Which PHP version are you targeting?

8.2+

Which Web server is JCB running on?

Apache 2.4.62

Which Relational Database is JCB running on?

11.7.2-MariaDB-ubu2404

Which OS is JCB running on?

Ubuntu 24.04.2

Which JCB version are you using?

5.1.1-beta2

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? When attempting to compile a component, even the Demo component, I am receiving a Fatal Error from the compiler. Compile Error: Declaration of VDM\Joomla\Componentbuilder\Compiler\Creator\FieldXML::get(string $setType, array &$fieldAttributes, string &$name, string &$typeName, string &$langView, string &$nameSingleCode, string &$nameListCode, array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = ''): stdClass must be compatible with VDM\Joomla\Componentbuilder\Compiler\Interfaces\Creator\Fieldtypeinterface::get(string $setType, array &$fieldAttributes, string $name, string $typeName, string $langView, string $nameSingleCode, string $nameListCode, array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = '') ### Steps to reproduce the Bug Install JCB 5.1.1-beta2 , and compile a component. ### Which Joomla version are you compiling in? 5.3.1 ### Which PHP version are you compiling in? 8.2.24 ### Which Joomla versions are you targeting? 5.x ### Which PHP version are you targeting? 8.2+ ### Which Web server is JCB running on? Apache 2.4.62 ### Which Relational Database is JCB running on? 11.7.2-MariaDB-ubu2404 ### Which OS is JCB running on? Ubuntu 24.04.2 ### Which JCB version are you using? 5.1.1-beta2 ### Where in JCB did this issue occur? Compilation of a component ### On which browsers did you encounter the issue? Firefox ### Additional Comments _No response_
mwweb added the
Bug
label 2025-06-23 02:30:06 +00:00
Member

Hello @mwweb,
I’ve tested both the HelloWorld and Demo components today, and I'm not encountering any issues.

  • I imported the HelloWorld component using JCB's new packaging engine on a fresh install of Beta2, and it compiled successfully.
  • I also tested the more advanced Demo component - both on a fresh install and an existing setup - and it compiled without any errors.

Since the Demo component is working in both environments on my end, it suggests the issue might be specific to your setup.
To help us diagnose the problem, could you confirm the following:

  1. Are you using a fresh install or an existing JCB system?
  2. Have you modified the Demo component in any way that could be affecting compilation?
  3. Can you share any code snippets that you think could be a issue.
  4. If possible, please include any changes or custom logic added to the Demo component.

Once we have more insight into your setup, and some additional debugging from your side, we’ll be better equipped to assist.

Hello @mwweb, I’ve tested both the HelloWorld and Demo components today, and I'm not encountering any issues. - I imported the HelloWorld component using JCB's new packaging engine on a fresh install of Beta2, and it compiled successfully. - I also tested the more advanced Demo component - both on a fresh install and an existing setup - and it compiled without any errors. Since the Demo component is working in both environments on my end, it suggests the issue might be specific to your setup. To help us diagnose the problem, could you confirm the following: 1. Are you using a fresh install or an existing JCB system? 2. Have you modified the Demo component in any way that could be affecting compilation? 3. Can you share any code snippets that you think could be a issue. 4. If possible, please include any changes or custom logic added to the Demo component. Once we have more insight into your setup, and some additional debugging from your side, we’ll be better equipped to assist.
Owner

Hi, @mwweb does your install still have /library/jcb_powers folders? please remove those, and install JCB again.

Also ensure that your projects are no longer using the default Namespace Prefix, and the default library location.

Looking in the Global Options of JCB under the Compiler tab:
image.png

Change this namespace to your company name.

Then under the Folder Paths tab:
image.png

Change the JCB Powers Path to a location other than the defaults...

When you compile your projects again... JCB will move all classes to this new location.

We are working on the option to move the classes into the component namespace and then add them under the component/src/ folder but at this point all powers are placed in the libary folder, at the location set in these two places.

You can on the component level override these values.

Hi, @mwweb does your install still have `/library/jcb_powers` folders? please remove those, and install JCB again. Also ensure that your projects are no longer using the default `Namespace Prefix`, and the default library location. Looking in the Global Options of JCB under the Compiler tab: ![image.png](https://git.vdm.dev/attachments/f0fcb1f3-aa72-45db-afd3-a24c12a2bd2e) Change this namespace to your company name. Then under the Folder Paths tab: ![image.png](https://git.vdm.dev/attachments/88606ebf-27d5-48b9-8266-0635a2dc6898) Change the `JCB Powers Path` to a location other than the defaults... When you compile your projects again... JCB will move all classes to this new location. We are working on the option to move the classes into the component namespace and then add them under the `component/src/` folder but at this point all powers are placed in the libary folder, at the location set in these two places. You can on the component level override these values.
Owner

These may not solve this issue, but it good to know... while the addressing this issue... lets look at the files as they are on the repository.

VDM\Joomla\Componentbuilder\Compiler\Creator\FieldXML::get

public function get(string $setType, array &$fieldAttributes, string &$name,
		string &$typeName, string &$langView, string &$nameSingleCode, string &$nameListCode,
		array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = '')

VDM\Joomla\Componentbuilder\Compiler\Interfaces\Creator\Fieldtypeinterface::get

public function get(string $setType, array &$fieldAttributes, string $name,
		string $typeName, string $langView, string $nameSingleCode, string $nameListCode,
		array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = '');

I see the pass by reference has changed... I will update these, and make it part of the next beta release.

I did not catch this... since I only use the String Manipulation build path, and not the XML :) but both should work, so Thanks!

These may not solve this issue, but it good to know... while the addressing this issue... lets look at the files as they are on the repository. [VDM\Joomla\Componentbuilder\Compiler\Creator\FieldXML::get](https://git.vdm.dev/joomla/Component-Builder/src/commit/dbebb5663cb6f2cecdf0f1427a371b2f63dcb18f/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Creator/FieldXML.php#L192) ```php public function get(string $setType, array &$fieldAttributes, string &$name, string &$typeName, string &$langView, string &$nameSingleCode, string &$nameListCode, array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = '') ``` [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Creator\Fieldtypeinterface::get](https://git.vdm.dev/joomla/Component-Builder/src/commit/dbebb5663cb6f2cecdf0f1427a371b2f63dcb18f/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Creator/Fieldtypeinterface.php#L41) ```php public function get(string $setType, array &$fieldAttributes, string $name, string $typeName, string $langView, string $nameSingleCode, string $nameListCode, array $placeholders, ?array &$optionArray, ?array $custom = null, string $taber = ''); ``` I see the pass by reference has changed... I will update these, and make it part of the next beta release. I did not catch this... since I only use the String Manipulation build path, and not the XML :) but both should work, so Thanks!
Owner

@Lemuel be sure to also test the build with the XML path set in the component global settings under the compiler tab:

image.png

@Lemuel be sure to also test the build with the XML path set in the component global settings under the compiler tab: ![image.png](https://git.vdm.dev/attachments/fb48d96a-bd97-4b17-87bb-4396f1e10e64)
Member

@Lemuel be sure to also test the build with the XML path set in the component global settings under the compiler tab:

Currently the default in the Global Config is SimpleXMLElement Class.
And the SimpleXMLElement Class comes as default with php8.0 and newer.

But in the Compiler when I compile it still got this message:
image.png

So with advice from @Llewellyn I ran the following commands in my Docker Container.
I'm using octojoom so it made the process quite simple:

In Terminal Run
- docker exec -it <joomlacontainer> /bin/bash
- apt-get update
- apt-get install -y libtidy-dev
- docker-php-ext-install tidy
- service apache2 restart

Now when I compile the Demo Component I no longer get that notice about the Tidy setup and everything is still compiling and installing correctly.

So coming back to the last reply on this issue:

I see the pass by reference has changed... I will update these, and make it part of the next beta release.
I did not catch this... since I only use the String Manipulation build path, and not the XML :) but both should work, so Thanks!

@mwweb, just wondering if you got a chance to check if this issue is resolved with the latest Beta5 release? We really appreciate all the feedback from the JCB community - your input's really helpful!
Let us know if the issue's sorted!

> @Lemuel be sure to also test the build with the XML path set in the component global settings under the compiler tab: Currently the default in the Global Config is `SimpleXMLElement Class`. And the `SimpleXMLElement Class` comes as default with php8.0 and newer. But in the Compiler when I compile it still got this message: ![image.png](https://git.vdm.dev/attachments/7cbd589c-183a-4a72-a2cf-44ec33eac650) So with advice from @Llewellyn I ran the following commands in my Docker Container. I'm using octojoom so it made the process quite simple: ``` In Terminal Run - docker exec -it <joomlacontainer> /bin/bash - apt-get update - apt-get install -y libtidy-dev - docker-php-ext-install tidy - service apache2 restart ``` Now when I compile the Demo Component I no longer get that notice about the Tidy setup and everything is still compiling and installing correctly. So coming back to the last reply on this issue: > I see the pass by reference has changed... I will update these, and make it part of the next beta release. > I did not catch this... since I only use the String Manipulation build path, and not the XML :) but both should work, so Thanks! @mwweb, just wondering if you got a chance to check if this issue is resolved with the latest [Beta5](https://git.vdm.dev/joomla/pkg-component-builder/archive/5.x.zip) release? We really appreciate all the feedback from the JCB community - your input's really helpful! Let us know if the issue's sorted!
Author

I did the testing, and the Tidy install (even though I had already done so).

Still received the fatal error.

However, I changed the Field Builder Type to String Manipulation, as Llewellyn uses, an I didn't receive the fatal error, and the component compiled.

Then, just on a whim I downloaded JCB 5.1.1-beta5 (I had beta2), and the component compiled with no issues with SimpleXML

I have an odd compile issue that I need to try to track down, but that is another issue. In a nutshell, my component has 4 tables, and compiles correctly, but when I install it creates my tables, plus numerous JCB tables, except with my component name instead of componentbuilder.

I did the testing, and the Tidy install (even though I had already done so). Still received the fatal error. However, I changed the Field Builder Type to String Manipulation, as Llewellyn uses, an I didn't receive the fatal error, and the component compiled. Then, just on a whim I downloaded JCB 5.1.1-beta5 (I had beta2), and the component compiled with no issues with SimpleXML I have an odd compile issue that I need to try to track down, but that is another issue. In a nutshell, my component has 4 tables, and compiles correctly, but when I install it creates my tables, plus numerous JCB tables, except with my component name instead of componentbuilder.
Author

A little more digging I found that in com_mycomponent_J5\libraries\mylibrary###.Joomla\src{MyComponent\Table.php, the JCB fields are in that table. Odd.

'link' => NULL, 'fields' => [ 'property' => [ 'name' => 'property', 'type' => 'pluginsclassproperties', 'link' => [ 'type' => 1, 'table' => '#__componentbuilder_class_property', 'component' => 'com_componentbuilder', 'entity' => 'class_property', 'value' => 'name', 'key' => 'guid', ], ], ], ], 'add_head' => [ 'name' => 'add_head', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_plugins', 'store' => NULL, 'tab_name' => 'Code', 'db' => [ 'type' => 'TINYINT(1)', 'default' => '0', 'GUID' => '65341477-33f1-4d58-9b3c-c371168809da', 'null_switch' => 'NOT NULL', 'unique_key' => false, 'key' => false, ], 'link' => NULL,

A little more digging I found that in com_mycomponent_J5\libraries\mylibrary\###.Joomla\src\{MyComponent\Table.php, the JCB fields are in that table. Odd. ` 'link' => NULL, 'fields' => [ 'property' => [ 'name' => 'property', 'type' => 'pluginsclassproperties', 'link' => [ 'type' => 1, 'table' => '#__componentbuilder_class_property', 'component' => 'com_componentbuilder', 'entity' => 'class_property', 'value' => 'name', 'key' => 'guid', ], ], ], ], 'add_head' => [ 'name' => 'add_head', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_plugins', 'store' => NULL, 'tab_name' => 'Code', 'db' => [ 'type' => 'TINYINT(1)', 'default' => '0', 'GUID' => '65341477-33f1-4d58-9b3c-c371168809da', 'null_switch' => 'NOT NULL', 'unique_key' => false, 'key' => false, ], 'link' => NULL, `
Owner

Please change VDM.Table content to like this:

	/**
	 * All areas/views/tables with their field details
	 *
	 * @var     array
	 * @since 3.2.0
	 **/
	protected array $tables = ###ALL_COMPONENT_FIELDS###;

image.png

The power GUID: bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8

It seems we released the power into the global repository accidentally with JCB code in it.
/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.power

I have now pushed out a fix... so just resetting the class will also fix it.

Just search for bfd1d6d5 and reset that class. That should resolve the issue.

Please change `VDM.Table` content to like this: ```php /** * All areas/views/tables with their field details * * @var array * @since 3.2.0 **/ protected array $tables = ###ALL_COMPONENT_FIELDS###; ``` ![image.png](https://git.vdm.dev/attachments/08ee9b87-2c3c-4565-916f-a9cbdbb3da32) The power GUID: `bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8` It seems we released the power into the global repository accidentally with JCB code in it. [/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.power](https://git.vdm.dev/joomla/super-powers/src/commit/14ce7fd87c00c53e1a55a4b7640ac7ada2ae3b01/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.power) I have now [pushed out a fix](https://git.vdm.dev/joomla/super-powers/src/commit/14ce7fd87c00c53e1a55a4b7640ac7ada2ae3b01/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.power)... so just resetting the class will also fix it. Just search for `bfd1d6d5` and reset that class. That should resolve the issue.
Author

Yay. I searched for the power GUID, opened it, performed a Reset, then recompiled my component, and it didn't install the extra JCB fields.

Yay. I searched for the power GUID, opened it, performed a Reset, then recompiled my component, and it didn't install the extra JCB fields.
mwweb closed this issue 2025-06-29 21:11:26 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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