Error Adding New Field to Admin View - Update MySQL Not Generated #1015

Closed
opened 2023-10-24 18:59:19 +00:00 by Obscerno · 2 comments
Member

Steps to reproduce the issue

I haven't worked out how to reproduce it with the Demo component yet. I'm sharing at this point because you may have some intuition on how to narrow it down.

In my existing project, I create a new field and add it to my admin view. Then, I compile.

Expected result

JCB generates all of the boilerplate for the new field, including the update MySQL.

Actual result

The first time a compile is attempted, it outputs the following error: Cannot access protected property VDM\Joomla\Componentbuilder\Compiler\Builder\UpdateMysql::$active

The second time a compile is attempted, it compiles successfully, but the update MySQL is not generated. The install MySQL IS generated.

This is inconsistent. Some new fields do generate the update MySQL, others fail. Additionally, I only ever get the error once for any given field. In other words, once a new field has resulted in an error, it will never generate update MySQL and will never again give the error. It's making it a bit hard to debug, but I'll keep trying!

System information

  • OS Name & Version: Ubuntu 22.04.3 LTS
  • MySql Version: 10.7.4-MariaDB-1:10.7.4+maria~focal-log
  • Apache Version: Apache/2.4.52
  • PHP Version: 8.2.11
  • Joomla Version: 3.10.12
  • JCB Version: 3.1.28
  • Browser: Firefox 118.0.2
### Steps to reproduce the issue I haven't worked out how to reproduce it with the Demo component yet. I'm sharing at this point because you may have some intuition on how to narrow it down. In my existing project, I create a new field and add it to my admin view. Then, I compile. ### Expected result JCB generates all of the boilerplate for the new field, including the update MySQL. ### Actual result The first time a compile is attempted, it outputs the following error: `Cannot access protected property VDM\Joomla\Componentbuilder\Compiler\Builder\UpdateMysql::$active` The second time a compile is attempted, it compiles successfully, but the **update** MySQL is not generated. The **install** MySQL *IS* generated. This is inconsistent. Some new fields do generate the update MySQL, others fail. Additionally, I only ever get the error once for any given field. In other words, once a new field has resulted in an error, it will never generate update MySQL and will never again give the error. It's making it a bit hard to debug, but I'll keep trying! ### System information - OS Name & Version: Ubuntu 22.04.3 LTS - MySql Version: 10.7.4-MariaDB-1:10.7.4+maria~focal-log - Apache Version: Apache/2.4.52 - PHP Version: 8.2.11 - Joomla Version: 3.10.12 - JCB Version: 3.1.28 - Browser: Firefox 118.0.2
Owner

I have fixed this issue in please try the beta-version: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip

Also note that Joomla 3 does not work well on PHP 8.1+ you should use PHP 8.0 (only)

I have fixed this issue in please try the beta-version: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip Also note that Joomla 3 does not work well on PHP 8.1+ you should use PHP 8.0 (only)
Author
Member

Thanks @Llewellyn, that fix worked!

And okay I will look into downgrading, thanks.

Thanks @Llewellyn, that fix worked! And okay I will look into downgrading, thanks.
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#1015
No description provided.