[BUG]: #1193 was closed but still not working #1199

Open
opened 2025-01-12 10:16:08 +00:00 by gerben65 · 1 comment

What Happened?

#1193 was closed, but is still an problem:

It seems that the JCB's Super Power feature incorrectly is placing additional use statements in the file below defined('_JEXEC') or die; and
#[\AllowDynamicProperties] , resulting in a syntax error.

// No direct access to this file
\defined('_JEXEC') or die;

/**

  • Foaralden Html View class for the Persons
  • @since 1.6
    */
    #[\AllowDynamicProperties]
    use JCB\Joomla\Utilities\ArrayHelper;
    use JCB\Joomla\Utilities\StringHelper;
    class HtmlView extends BaseHtmlView
    {

It seems to occure with the following powers:

use JCB\Joomla\Utilities\ArrayHelper;
use JCB\Joomla\Utilities\StringHelper;

Steps to reproduce the Bug

It occured after adding Add [AllowDynamicProperties] in the base view class for J5 in v5.0.1 alpha 1. With v5.03 all works fine.

Installing on my Synology NAS (Docker) made no difference.

Callstack:

Er heeft zich een fout voorgedaan.
0 syntax error, unexpected token "use"
Call Stack

Function Location

1 () JROOT\administrator\components\com_**\src\View\Familytrees\HtmlView.php:47
2 Composer\Autoload{closure}() JROOT\libraries\vendor\composer\ClassLoader.php:427
3 Composer\Autoload\ClassLoader->loadClass() JROOT\libraries\src\Autoload\ClassLoader.php:59
4 Joomla\CMS\Autoload\ClassLoader->loadClass()
5 class_exists() JROOT\libraries\src\MVC\Factory\MVCFactory.php:299
6 Joomla\CMS\MVC\Factory\MVCFactory->getClassName() JROOT\libraries\src\MVC\Factory\MVCFactory.php:214
7 Joomla\CMS\MVC\Factory\MVCFactory->createView() JROOT\libraries\src\MVC\Controller\BaseController.php:610
8 Joomla\CMS\MVC\Controller\BaseController->createView() JROOT\libraries\src\MVC\Controller\BaseController.php:879
9 Joomla\CMS\MVC\Controller\BaseController->getView() JROOT\libraries\src\MVC\Controller\BaseController.php:656
10 Joomla\CMS\MVC\Controller\BaseController->display() JROOT\administrator\components\com_foaralden\src\Controller\DisplayController.php:52
11 JCB\Component\Foaralden\Administrator\Controller\DisplayController->display() JROOT\libraries\src\MVC\Controller\BaseController.php:731
12 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143
13 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT\libraries\src\Component\ComponentHelper.php:361
14 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\AdministratorApplication.php:150
15 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT\libraries\src\Application\AdministratorApplication.php:195
16 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:306
17 Joomla\CMS\Application\CMSApplication->execute() JROOT\administrator\includes\app.php:58
18 require_once() JROOT\administrator\index.php:32

Which Joomla version are you compiling in?

see above

Which PHP version are you compiling in?

8.1

Which Joomla versions are you targeting?

see above

Which PHP version are you targeting?

8.1

Which Web server is JCB running on?

Apache 2.4

Which Relational Database is JCB running on?

MariaDB

Which OS is JCB running on?

xampp/synology

Which JCB version are you using?

see above

Where in JCB did this issue occur?

Compilation of a component

On which browsers did you encounter the issue?

Firefox

Additional Comments

Is it related to #1121?

### What Happened? #1193 was closed, but is still an problem: It seems that the JCB's Super Power feature incorrectly is placing additional use statements in the file below defined('_JEXEC') or die; and #[\AllowDynamicProperties] , resulting in a syntax error. // No direct access to this file \defined('_JEXEC') or die; /** * Foaralden Html View class for the Persons * * @since 1.6 */ #[\AllowDynamicProperties] use JCB\Joomla\Utilities\ArrayHelper; use JCB\Joomla\Utilities\StringHelper; class HtmlView extends BaseHtmlView { It seems to occure with the following powers: use JCB\Joomla\Utilities\ArrayHelper; use JCB\Joomla\Utilities\StringHelper; ### Steps to reproduce the Bug It occured after adding Add [AllowDynamicProperties] in the base view class for J5 in v5.0.1 alpha 1. With v5.03 all works fine. Installing on my Synology NAS (Docker) made no difference. Callstack: Er heeft zich een fout voorgedaan. 0 syntax error, unexpected token "use" Call Stack # Function Location 1 () JROOT\administrator\components\com_**\src\View\Familytrees\HtmlView.php:47 2 Composer\Autoload\{closure}() JROOT\libraries\vendor\composer\ClassLoader.php:427 3 Composer\Autoload\ClassLoader->loadClass() JROOT\libraries\src\Autoload\ClassLoader.php:59 4 Joomla\CMS\Autoload\ClassLoader->loadClass() 5 class_exists() JROOT\libraries\src\MVC\Factory\MVCFactory.php:299 6 Joomla\CMS\MVC\Factory\MVCFactory->getClassName() JROOT\libraries\src\MVC\Factory\MVCFactory.php:214 7 Joomla\CMS\MVC\Factory\MVCFactory->createView() JROOT\libraries\src\MVC\Controller\BaseController.php:610 8 Joomla\CMS\MVC\Controller\BaseController->createView() JROOT\libraries\src\MVC\Controller\BaseController.php:879 9 Joomla\CMS\MVC\Controller\BaseController->getView() JROOT\libraries\src\MVC\Controller\BaseController.php:656 10 Joomla\CMS\MVC\Controller\BaseController->display() JROOT\administrator\components\com_foaralden\src\Controller\DisplayController.php:52 11 JCB\Component\Foaralden\Administrator\Controller\DisplayController->display() JROOT\libraries\src\MVC\Controller\BaseController.php:731 12 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143 13 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT\libraries\src\Component\ComponentHelper.php:361 14 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\AdministratorApplication.php:150 15 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT\libraries\src\Application\AdministratorApplication.php:195 16 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:306 17 Joomla\CMS\Application\CMSApplication->execute() JROOT\administrator\includes\app.php:58 18 require_once() JROOT\administrator\index.php:32 ### Which Joomla version are you compiling in? see above ### Which PHP version are you compiling in? 8.1 ### Which Joomla versions are you targeting? see above ### Which PHP version are you targeting? 8.1 ### Which Web server is JCB running on? Apache 2.4 ### Which Relational Database is JCB running on? MariaDB ### Which OS is JCB running on? xampp/synology ### Which JCB version are you using? see above ### Where in JCB did this issue occur? Compilation of a component ### On which browsers did you encounter the issue? Firefox ### Additional Comments Is it related to #1121?
gerben65 added the
Bug
label 2025-01-12 10:16:09 +00:00
Lemuel pinned this 2025-01-12 15:42:53 +00:00
Lemuel unpinned this 2025-01-12 15:42:56 +00:00
Owner

Thank you for raising this issue. After carefully reviewing your report, we’ve tested the same functionality within the environments we use for JCB development, and we have not been able to reproduce the behavior you described. This includes testing the generation of HTMLView.php files where use statements are positioned correctly above the #[\AllowDynamicProperties] tag.

As a team, we develop and test JCB within a consistent environment using Docker deployed via Octojoom, primarily on Ubuntu systems. This is not because we believe this setup is inherently better than others, but simply because it allows us to maintain a reliable and unified environment for development and testing.

Given that we cannot reproduce the issue in our environment, we are unable to diagnose or resolve this problem without further insights. We kindly suggest trying to replicate your setup within a similar environment to ours—specifically using Octojoom with Docker on Ubuntu or Mac to see if the issue persists. If it does, we’d be happy to assist further.

Unfortunately, our current resources do not allow us to investigate or address platform-specific issues outside of this development environment. We hope for your understanding in this matter and deeply value your contributions to improving JCB.

Please let us know if you’d like assistance setting up a similar environment or if you encounter additional issues.

Thank you for raising this issue. After carefully reviewing your report, we’ve tested the same functionality within the environments we use for JCB development, and we have not been able to reproduce the behavior you described. This includes testing the generation of `HTMLView.php` files where `use` statements are positioned correctly above the `#[\AllowDynamicProperties]` tag. As a team, we develop and test JCB within a consistent environment using **Docker** deployed via **Octojoom**, primarily on **Ubuntu** systems. This is not because we believe this setup is inherently better than others, but simply because it allows us to maintain a reliable and unified environment for development and testing. Given that we cannot reproduce the issue in our environment, we are unable to diagnose or resolve this problem without further insights. We kindly suggest trying to replicate your setup within a similar environment to ours—specifically using [Octojoom](https://git.vdm.dev/octoleo/octojoom) with Docker on Ubuntu or Mac to see if the issue persists. If it does, we’d be happy to assist further. Unfortunately, our current resources do not allow us to investigate or address platform-specific issues outside of this development environment. We hope for your understanding in this matter and deeply value your contributions to improving JCB. Please let us know if you’d like assistance setting up a similar environment or if you encounter additional issues.
Sign in to join this conversation.
No Milestone
No project
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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