0 VDM\Joomla\Componentbuilder\Compiler\Language\Update::set(): Argument #2 ($target) must be of type string, array given, called in C:\laragon\www\joomla3\libraries\vendor_jcb\VDM.Joomla\src\Componentbuilder\Compiler\Language\Purge.php on line 165 #1172
Reference in new issue
Block a user
Steps to reproduce the issue
Good morning, I'm asking for your help in solving a problem that I can't overcome on my own. I'm trying to create a component for the first time. I just created an admin view with a couple of fields and then added the translations in my language.
The error appears when I try to compile the component.
Expected result
compiled component
Actual result
0 VDM\Joomla\Componentbuilder\Compiler\Language\Update::set(): Argument #2 ($target) must be of type string, array given, called in C:\laragon\www\joomla3\libraries\vendor_jcb\VDM.Joomla\src\Componentbuilder\Compiler\Language\Purge.php on line 165
System information (as much as possible)
Additional comments
I would exclude the PHP version as the cause of the problem because I tried with different versions.
Thank you
I will take a look at this... are you able to debug this?
I don't know what to do...
I just ran into this same error when i upgraded a component dev enviro from j3 to j5. On J5 i can still compile fine for J3 but when i tick option to compile for J5 i get the exact same error.
on this line you clearly see it is sending an array to a function that should get a string as second parameter:
Link of the target function it is sent to:
it's an empty array that is in the $targets variable.
I refactored the Purge class a little, if you can drop it in place and test and let me know if it resolves the bug.
This bug has been resolved in newer versions of JCB and is no longer present in the current JCB 4.x, 5.x, and 6.x implementations.
Since the refactoring work explained here in this issue has been moved into JCB and is in the latest release, we will be closing this issue.