[BUG]: JCB 4.1.5 fails to compile after upgrading from JCB 3 #1316

Closed
opened 2026-07-26 02:52:54 +00:00 by Chris Paschen · 2 comments

What Happened?

Upgraded the site and then JCB from Joomla 3 / JCB3 -> Joomla 4 / JCB4 (following: https://github.com/orgs/joomengine/discussions/999)

When trying to compile I get:
An error has occurred
0 Class "VDM\Plugin\Extension\ComponentbuilderLanguagePackaging\Extension\CFactory" not found

Steps to reproduce the Bug

  • Upgrade Joomla 3.10.12 to Joomla 4.4.14
  • Install JCB 4.1.5 (JCB 3 still installed; installed over top)
  • Fix db
  • Compile prevous JCB component

Get the error

Which Joomla version are you compiling in?

4.4.14

Which PHP version are you compiling in?

8.3.32

Which Joomla versions are you targeting?

4

Which PHP version are you targeting?

8.3.32

Which Web server is JCB running on?

Apache

Which Relational Database is JCB running on?

MariaDB 10.11.14

Which OS is JCB running on?

Linux Ubuntu 24.04

Which JCB version are you using?

4.1.5

Where in JCB did this issue occur?

Compilation of a component

On which browsers did you encounter the issue?

Firefox

Additional Comments

(browser is actually LibreWolf, but that option wasn't available)

Resolved by adding:

use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;

to the openin header area of /plugins/extension/componentbuilderlanguagepackaging/src/Extension/ComponentbuilderLanguagePackaging.php

I'm not sure if this is the best solutions, but it SEEMS to have resolved the error.

### What Happened? Upgraded the site and then JCB from Joomla 3 / JCB3 -> Joomla 4 / JCB4 (following: https://github.com/orgs/joomengine/discussions/999) When trying to compile I get: An error has occurred 0 Class "VDM\Plugin\Extension\ComponentbuilderLanguagePackaging\Extension\CFactory" not found ### Steps to reproduce the Bug - Upgrade Joomla 3.10.12 to Joomla 4.4.14 - Install JCB 4.1.5 (JCB 3 still installed; installed over top) - Fix db - Compile prevous JCB component Get the error ### Which Joomla version are you compiling in? 4.4.14 ### Which PHP version are you compiling in? 8.3.32 ### Which Joomla versions are you targeting? 4 ### Which PHP version are you targeting? 8.3.32 ### Which Web server is JCB running on? Apache ### Which Relational Database is JCB running on? MariaDB 10.11.14 ### Which OS is JCB running on? Linux Ubuntu 24.04 ### Which JCB version are you using? 4.1.5 ### Where in JCB did this issue occur? Compilation of a component ### On which browsers did you encounter the issue? Firefox ### Additional Comments (browser is actually LibreWolf, but that option wasn't available) Resolved by adding: use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; to the openin header area of /plugins/extension/componentbuilderlanguagepackaging/src/Extension/ComponentbuilderLanguagePackaging.php I'm not sure if this is the best solutions, but it SEEMS to have resolved the error.
Chris Paschen added the Bug label 2026-07-26 02:52:54 +00:00
Owner

Hi @cpaschen

Thank you for bringing this issue to our attention. After thoroughly reviewing the code in the plugin, we confirm that the bug you identified is legitimate. However, we want to clarify that modifying the use statement is not the recommended solution.

Root Cause and Fix
The issue stems from two specific instances within the class where CFactory is referenced. The correct resolution is to replace these instances with Factory, as Factory is the designated method for Joomla 4+ implementations. This adjustment aligns with the framework's current standards and resolves the problem without introducing further complications.

Important Notes

  • Avoid Changing the Use Statement: Updating the use statement to CFactory would result in class resolution errors, as Factory classes are no longer compatible with this approach.
  • Targeted Edits: On line 370 and line 377 replace CFactory with Factory. This change will immediately resolve the issue without disrupting other parts of the code.

Next Steps
We have already implemented this fix internally and will include it in our upcoming release. In the interim, we recommend applying the targeted changes to ensure stability. If you require further assistance or have questions about the implementation, please do not hesitate to reach out.

Once again, thank you for your proactive feedback. Your contribution helps us maintain the highest quality for all users.

Hi @cpaschen Thank you for bringing this issue to our attention. After thoroughly reviewing the code in the plugin, we confirm that the bug you identified is legitimate. However, we want to clarify that modifying the use statement is not the recommended solution. **Root Cause and Fix** The issue stems from two specific instances within the class where `CFactory` is referenced. The correct resolution is to replace these instances with `Factory`, as `Factory` is the designated method for Joomla 4+ implementations. This adjustment aligns with the framework's current standards and resolves the problem without introducing further complications. **Important Notes** - **Avoid Changing the Use Statement:** Updating the use statement to `CFactory` would result in class resolution errors, as `Factory` classes are no longer compatible with this approach. - **Targeted Edits:** On [line 370](https://git.vdm.dev/joomla/plg_extension_componentbuilderlanguagepackaging/src/commit/f5e7a93320f40fdd53ebc92400d57eb6eb735941/src/Extension/ComponentbuilderLanguagePackaging.php#L370) and [line 377](https://git.vdm.dev/joomla/plg_extension_componentbuilderlanguagepackaging/src/commit/f5e7a93320f40fdd53ebc92400d57eb6eb735941/src/Extension/ComponentbuilderLanguagePackaging.php#L377) replace `CFactory` with `Factory`. This change will immediately resolve the issue without disrupting other parts of the code. **Next Steps** We have already implemented this fix internally and will include it in our upcoming release. In the interim, we recommend applying the targeted changes to ensure stability. If you require further assistance or have questions about the implementation, please do not hesitate to reach out. Once again, thank you for your proactive feedback. Your contribution helps us maintain the highest quality for all users.
Owner

@cpaschen this fix has been rolled out with the latest v6.2.0 release. This issue can now be closed.

@cpaschen this fix has been rolled out with the latest [v6.2.0 release](https://git.vdm.dev/joomla/pkg-component-builder/releases/tag/v6.2.0). This issue can now be closed.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1316