[BUG]: missing 'use' in admin tmpls #1117

Open
opened 2024-05-02 15:28:29 +00:00 by Polmock · 2 comments

What Happened?

I've installed the component on my joomla site, but navigating the component dashboard I get an error (ArrayHelper is not defined).

I can fix the problem addding
use JCB\Joomla\Utilities\ArrayHelper;
at the top of these files:
-admin/tmpl/<component_name>/default_vdm.php
-admin/tmpl/import/default.php

Steps to reproduce the Bug

Create the component, build and install

Which Joomla version are you compiling in?

3.10.12

Which PHP version are you compiling in?

8.2.2

Which Joomla versions are you targeting?

4.4.4

Which PHP version are you targeting?

8.2.4

Which Web server is JCB running on?

Apache 2.4

Which Relational Database is JCB running on?

MySql 8.0

Which OS is JCB running on?

Windows 11

Which JCB version are you using?

3.2.1-rc4

Where in JCB did this issue occur?

Compilation of a component, Dashboard(admin_view)

On which browsers did you encounter the issue?

Firefox, Chrome

Additional Comments

No response

### What Happened? I've installed the component on my joomla site, but navigating the component dashboard I get an error (ArrayHelper is not defined). I can fix the problem addding `use JCB\Joomla\Utilities\ArrayHelper;` at the top of these files: -admin/tmpl/<component_name>/default_vdm.php -admin/tmpl/import/default.php ### Steps to reproduce the Bug Create the component, build and install ### Which Joomla version are you compiling in? 3.10.12 ### Which PHP version are you compiling in? 8.2.2 ### Which Joomla versions are you targeting? 4.4.4 ### Which PHP version are you targeting? 8.2.4 ### Which Web server is JCB running on? Apache 2.4 ### Which Relational Database is JCB running on? MySql 8.0 ### Which OS is JCB running on? Windows 11 ### Which JCB version are you using? 3.2.1-rc4 ### Where in JCB did this issue occur? Compilation of a component, Dashboard(admin_view) ### On which browsers did you encounter the issue? Firefox, Chrome ### Additional Comments _No response_
Polmock added the
Bug
label 2024-05-02 15:28:29 +00:00
Owner

Hmm this one seems strange since the ArrayHelper is loaded via the SUPER power implementation. Which means it should add the use statement automatically.

Which it is doing in all my extensions (to name a few):

Which means we will need to look a little closer at this issue... since the use statement is not added, we will need some extra details as to understand why... and does it also not add it in other areas.

The new Super Power feature adds classes based on the SPK key that you can see here. This Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power is the SPK for the ArrayHelper class.

Hmm this one seems strange since the `ArrayHelper` is loaded via the SUPER power implementation. Which means it should add the `use` statement automatically. Which it is doing in all my extensions (to name a few): - https://git.vdm.dev/getBible/joomla-component/src/branch/5.x/admin/tmpl/getbible/default_vdm.php#L19 - https://git.vdm.dev/getBible/joomla-component/src/branch/5.x/admin/tmpl/getbible/default_vdm.php#L19 - https://git.vdm.dev/getBible/joomla-component/src/branch/3.x/admin/views/getbible/tmpl/default_vdm.php#L22 - https://git.vdm.dev/joomla/Component-Builder/src/branch/5.x/admin/tmpl/componentbuilder/default_vdm.php#L13 - https://git.vdm.dev/joomla/Component-Builder/src/branch/4.x/admin/tmpl/componentbuilder/default_vdm.php#L13 - https://git.vdm.dev/joomla/Component-Builder/src/branch/3.x/admin/views/componentbuilder/tmpl/default_vdm.php#L16 Which means we will need to look a little closer at this issue... since the `use` statement is not added, we will need some extra details as to understand why... and does it also not add it in other areas. The new Super Power feature adds classes based on the SPK key that you can [see here](https://git.vdm.dev/joomla/Component-Builder/src/commit/a24b5a0757e3bf30889c312c057147c776ea4434/admin/compiler/joomla_4/default_vdm.php#L33). This `Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power` is the SPK for the `ArrayHelper` class.
Author

What I can say, is that I've upgraded an existing installation of JCB version 2.13 directly to version 3.1. And that I was trying to recompile an existing component which was compiling in version 2.13 in this new JCB, targetting Joomla 4. Maybe I've missed some steps in the upgrade?

What I can say, is that I've upgraded an existing installation of JCB version 2.13 directly to version 3.1. And that I was trying to recompile an existing component which was compiling in version 2.13 in this new JCB, targetting Joomla 4. Maybe I've missed some steps in the upgrade?
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#1117
No description provided.