Add a new Database table is compiling the component, but by updating making not the tabel #960

Closed
opened 2022-10-16 15:13:44 +00:00 by Schrijvers123 · 11 comments
Member

Steps to reproduce the issue

Make a new adminview
Add some fields to it.
Conenct it to you excisting component
Compile the component
Install the component on the excisiting one

Expected result

Was acpeting the new admin view and the database

Actual result

Menu is made, but the actualy database table not.

In the install.mysql.utf8.sql I see that the table will be made (during installation), byt in the update version it is empty. If I look in JCB by the conmponent updates, the field is for that version also empty. It looks that it is impossible to add new vies.

After I made some changes inm the admin viet in the sql tab, I recomplited the component. Now it made a new version, only i got an error: table doesn't excist.

Very stange behavoir.

### Steps to reproduce the issue Make a new adminview Add some fields to it. Conenct it to you excisting component Compile the component Install the component on the excisiting one ### Expected result Was acpeting the new admin view and the database ### Actual result Menu is made, but the actualy database table not. In the install.mysql.utf8.sql I see that the table will be made (during installation), byt in the update version it is empty. If I look in JCB by the conmponent updates, the field is for that version also empty. It looks that it is impossible to add new vies. After I made some changes inm the admin viet in the sql tab, I recomplited the component. Now it made a new version, only i got an error: table doesn't excist. Very stange behavoir.
Owner

Before I jump into this, and try to debug... have you watched these tutorial:
https://youtu.be/bRPJTRat158
https://youtu.be/ZxC6z701ixA

So that you can honestly say that this issues is not explained how to resolve in these tutorials?

I ask this since I also use JCB everyday and I am not seeing this issue, and I am wondering what exactly is the edge-case that is causing this, that has not been explained before.

Since Like I have said many times (in the above tutorials and many issues) JCB needs history for this automated DB code to work, and for that reason an imported component will not have this behaviour, and there is not yet at this time away around this limitation.

Exept opening many key areas and saving them manually, so to create the needed history... maybe I can list these areas.

Like for the view DB code to be added the following steps needed to be taken on an imported component or otherwise (no history) component:

To Prepare Component with No History

@startuml
skinparam backgroundColor #EEEBDC
skinparam handwritten true

skinparam sequenceArrowColor DeepSkyBlue
skinparam sequenceActorBorderColor DeepSkyBlue
skinparam sequenceLifeLineBorderColor blue
skinparam sequenceLifeLineBackgroundColor #A9DCDF
skinparam sequenceParticipantBorderColor DeepSkyBlue
skinparam sequenceParticipantBackgroundColor DodgerBlue
skinparam sequenceParticipantFontName Impact
skinparam sequenceParticipantFontSize 17
skinparam sequenceParticipantFontColor #A9DCDF
skinparam sequenceActorBackgroundColor aqua
skinparam sequenceActorFontColor DeepSkyBlue
skinparam sequenceActorFontSize 17
skinparam sequenceActorFontName Aapex

actor User
participant "No History Component" as Component
participant "Component Admin Views" as AdminViews
participant "History" as History
participant "Compiler" as Compiler

User -> Component: Go to Joomla Components view
activate Component

Component --> AdminViews: Open Component Admin Views
activate AdminViews

AdminViews ---> History: Click Save and Close
activate History
History ----> Compiler: Compile the Component
activate Compiler

Compiler ----> History: Compiler Notes History
deactivate Compiler

History ---> AdminViews: Component Admin Views History Locked-in
deactivate History

AdminViews --> Component: Admin Views Known to Compiler Hisory
deactivate AdminViews

Component -> User: Component Now Has History
deactivate Component

@enduml

Add View SQL

@startuml
skinparam backgroundColor #EEEBDC
skinparam handwritten true

skinparam sequenceArrowColor DeepSkyBlue
skinparam sequenceActorBorderColor DeepSkyBlue
skinparam sequenceLifeLineBorderColor blue
skinparam sequenceLifeLineBackgroundColor #A9DCDF
skinparam sequenceParticipantBorderColor DeepSkyBlue
skinparam sequenceParticipantBackgroundColor DodgerBlue
skinparam sequenceParticipantFontName Impact
skinparam sequenceParticipantFontSize 17
skinparam sequenceParticipantFontColor #A9DCDF
skinparam sequenceActorBackgroundColor aqua
skinparam sequenceActorFontColor DeepSkyBlue
skinparam sequenceActorFontSize 17
skinparam sequenceActorFontName Aapex

actor User
participant "Component With History" as Component
participant "View" as View
participant "Component Admin Views" as AdminViews
participant "History" as History
participant "Compiler" as Compiler

User -> View: Create new View
activate View

View --> Component: Open Component
activate Component

Component ---> AdminViews: Link new view to Component
activate AdminViews

AdminViews ----> History: Click Save and Close
activate History

History -----> Compiler: Compile the Component
activate Compiler

Compiler -----> History: Compiler See History Changed
deactivate Compiler

History ----> AdminViews: Compiler Adds SQL for new Table
deactivate History

AdminViews ---> Component: Component Version Increments
deactivate AdminViews

Component --> View: Component History is updated
deactivate Component

View -> User: New View Works on Install
deactivate View

@enduml

This should always produce the SQL, and you can check this by opening the SQL Update area manually as explained in the turorials mentioned above.

Before I jump into this, and try to debug... have you watched these tutorial: https://youtu.be/bRPJTRat158 https://youtu.be/ZxC6z701ixA So that you can honestly say that this issues is not explained how to resolve in these tutorials? I ask this since I also use JCB everyday and I am not seeing this issue, and I am wondering what exactly is the edge-case that is causing this, that has not been explained before. Since Like I have said many times (in the above tutorials and many issues) JCB needs **history** for this automated DB code to work, and for that reason an imported component will not have this behaviour, and there is not yet at this time away around this limitation. *Exept opening many key areas and saving them manually*, so to create the needed history... maybe I can list these areas. Like for the view DB code to be added the following steps needed to be taken on an imported component or otherwise (no history) component: #### To Prepare Component with No History ```uml @startuml skinparam backgroundColor #EEEBDC skinparam handwritten true skinparam sequenceArrowColor DeepSkyBlue skinparam sequenceActorBorderColor DeepSkyBlue skinparam sequenceLifeLineBorderColor blue skinparam sequenceLifeLineBackgroundColor #A9DCDF skinparam sequenceParticipantBorderColor DeepSkyBlue skinparam sequenceParticipantBackgroundColor DodgerBlue skinparam sequenceParticipantFontName Impact skinparam sequenceParticipantFontSize 17 skinparam sequenceParticipantFontColor #A9DCDF skinparam sequenceActorBackgroundColor aqua skinparam sequenceActorFontColor DeepSkyBlue skinparam sequenceActorFontSize 17 skinparam sequenceActorFontName Aapex actor User participant "No History Component" as Component participant "Component Admin Views" as AdminViews participant "History" as History participant "Compiler" as Compiler User -> Component: Go to Joomla Components view activate Component Component --> AdminViews: Open Component Admin Views activate AdminViews AdminViews ---> History: Click Save and Close activate History History ----> Compiler: Compile the Component activate Compiler Compiler ----> History: Compiler Notes History deactivate Compiler History ---> AdminViews: Component Admin Views History Locked-in deactivate History AdminViews --> Component: Admin Views Known to Compiler Hisory deactivate AdminViews Component -> User: Component Now Has History deactivate Component @enduml ``` #### Add View SQL ```uml @startuml skinparam backgroundColor #EEEBDC skinparam handwritten true skinparam sequenceArrowColor DeepSkyBlue skinparam sequenceActorBorderColor DeepSkyBlue skinparam sequenceLifeLineBorderColor blue skinparam sequenceLifeLineBackgroundColor #A9DCDF skinparam sequenceParticipantBorderColor DeepSkyBlue skinparam sequenceParticipantBackgroundColor DodgerBlue skinparam sequenceParticipantFontName Impact skinparam sequenceParticipantFontSize 17 skinparam sequenceParticipantFontColor #A9DCDF skinparam sequenceActorBackgroundColor aqua skinparam sequenceActorFontColor DeepSkyBlue skinparam sequenceActorFontSize 17 skinparam sequenceActorFontName Aapex actor User participant "Component With History" as Component participant "View" as View participant "Component Admin Views" as AdminViews participant "History" as History participant "Compiler" as Compiler User -> View: Create new View activate View View --> Component: Open Component activate Component Component ---> AdminViews: Link new view to Component activate AdminViews AdminViews ----> History: Click Save and Close activate History History -----> Compiler: Compile the Component activate Compiler Compiler -----> History: Compiler See History Changed deactivate Compiler History ----> AdminViews: Compiler Adds SQL for new Table deactivate History AdminViews ---> Component: Component Version Increments deactivate AdminViews Component --> View: Component History is updated deactivate Component View -> User: New View Works on Install deactivate View @enduml ``` This should always produce the SQL, and you can check this by opening the SQL Update area manually as explained in the turorials mentioned above.
Author
Member

Hi Llewellyn,

I wil do all test today and keep you posted.

Hi Llewellyn, I wil do all test today and keep you posted.
Author
Member

First result when i use the steps in movie one: https://vimeo.com/schrijvers123/review/761370429/9290edae2a

Here you see no table made.

First result when i use the steps in movie one: https://vimeo.com/schrijvers123/review/761370429/9290edae2a Here you see no table made.
Author
Member

Evrystep I do is not solving the issue

I treid to build a new component. Also that one is failing.

Never saw this before. What am I doing wrong? My development has been stopped for now.

Evrystep I do is not solving the issue I treid to build a new component. Also that one is failing. Never saw this before. What am I doing wrong? My development has been stopped for now.
Owner

Thank you for your willingness to give more detailed demostration... I have now investicated it and it seems like we have a bug, and I will fix this ASAP.

Will push a release soon as I have it ready.

Thank you for your willingness to give more detailed demostration... I have now investicated it and it seems like we have a bug, and I will fix this ASAP. Will push a release soon as I have it ready.
Llewellyn added the
Bug
label 2022-10-18 14:46:13 +00:00
Llewellyn added this to the Compiler Refactoring milestone 2022-10-18 14:46:29 +00:00
Llewellyn self-assigned this 2022-10-18 14:46:35 +00:00
Author
Member

Thanks for picking it up @Llewellyn

Thanks for picking it up @Llewellyn
Owner

Okay after much more tests I realize there is no bug, it simply is the problem of adding the view at the wrong moment of the component state in its history tracking.

To explain this in more details I have made yet another tutorial to try and help all who may fall in to this edge-case situation.

That since normally this will not happen... watch the tutorial :)
image

By the way this is one of the areas that is keeping us beck from moving to Joomla 4, since how Joomla integrade with the history component in Joomla 4 is very diffrent from Joomla 3.

Okay after much more tests I realize there is no bug, it simply is the problem of adding the view at the wrong moment of the component state in its history tracking. To explain this in more details I have made yet another tutorial to try and help all who may fall in to this edge-case situation. That since normally this will not happen... watch the tutorial :) [![image](/attachments/eed6bc8a-9bd2-4a4f-9b41-0db65c5e9235)](https://youtu.be/55U8FDlLI7Q) By the way this is one of the areas that is keeping us beck from moving to Joomla 4, since how Joomla integrade with the history component in Joomla 4 is very diffrent from Joomla 3.
490 KiB
Llewellyn removed the
Bug
label 2022-10-18 21:05:26 +00:00
Llewellyn removed this from the Compiler Refactoring milestone 2022-10-18 21:05:37 +00:00
Llewellyn removed their assignment 2022-10-18 21:05:45 +00:00
Owner

If your still having more issues after watching that new tutorial, just bump this issue again with your findings...

If your still having more issues after watching that new tutorial, just bump this issue again with your findings...
Author
Member

Hi @Llewellyn

Again, thanks for your hekp.

It was indeed that the component had no history version. After following your steps it was working again.

How did I run into that problem?
What I did, I moved the production to staging with akeebabackup (something i shoulded have done before). And to be sure it should be development (for a better development cycle).

It seems that this caused a lost of the history. Although it was strange because I used Akeeback up to bring it back.

In your mmovie you also saying if I imported the package it has also no history. Is this not risky that a lot of people will run into this problem?

Possible Solution
Is it an idea to make a button that checkes everything and if nessesary fix it automaticly (or is doing it also during import)? Try to think how to solve this issue.

Other way is that if a component has no history, that somewhere will be a warning message?

Thanks for clearyfing and helping solving the issue.

Hi @Llewellyn Again, thanks for your hekp. It was indeed that the component had no history version. After following your steps it was working again. **How did I run into that problem?** What I did, I moved the production to staging with akeebabackup (something i shoulded have done before). And to be sure it should be development (for a better development cycle). It seems that this caused a lost of the history. Although it was strange because I used Akeeback up to bring it back. In your mmovie you also saying if I imported the package it has also no history. Is this not risky that a lot of people will run into this problem? **Possible Solution** Is it an idea to make a button that checkes everything and if nessesary fix it automaticly (or is doing it also during import)? Try to think how to solve this issue. Other way is that if a component has no history, that somewhere will be a warning message? Thanks for clearyfing and helping solving the issue.
Owner

@Schrijvers123 you do realize that whould there be an easy solution I would have already build it, yet the reality no simple solution exist.

Sure when you have a small system... one or two components. But most of my systems have 50+ components and thousands of fields linked to 10 or more components, and even the views are shared between components. This complex relationships cause an increase of the challange to track this... import a component into a system like this, where the field could match those of other extentions and you litrially have to save every area in the system and compile each component. Since that small "compile first" before you add the new "whatever" is where the bottleneck is found.

That small step does a huge task and is not easilly duplicated outside of the compiler. We may after the compiler refactoring circle back to this issue and be able to solve it... but the way things work now... making the tutorial and having this issue, struggling with it for days is the short answer and the only real solution.

Adding a notice and a link to the tutorials and posible this issue will be helpful. Yet if you search over the issues, you will find previous issues on the same topic and even tutorials made address this same issue over and over. Since its seems like saying and even drawing "like I did at the outset of this issue" does not help. The words used to explain and the demostrations still seem to leave out the very simple premiss of the issue.

Which as stated over and over is that the component needs history for this feature to work.

@Schrijvers123 you do realize that whould there be an easy solution I would have already build it, yet the reality no simple solution exist. Sure when you have a small system... one or two components. But most of my systems have 50+ components and thousands of fields linked to 10 or more components, and even the views are shared between components. This complex relationships cause an increase of the challange to track this... import a component into a system like this, where the field could match those of other extentions and you litrially have to save every area in the system and compile each component. Since that small "compile first" before you add the new "whatever" is where the bottleneck is found. That small step does a huge task and is not easilly duplicated outside of the compiler. We may after the **compiler refactoring** circle back to this issue and be able to solve it... but the way things work now... making the tutorial and having this issue, struggling with it for days is the short answer and the only real solution. Adding a notice and a link to the tutorials and posible this issue will be helpful. Yet if you search over the issues, you will find previous issues on the same topic and even tutorials made address this same issue over and over. Since its seems like saying and even drawing "like I did at the outset of this issue" does not help. The words used to explain and the demostrations still seem to leave out the very simple premiss of the issue. *Which as stated over and over is that the component needs history for this feature to work.*
Author
Member

Hello @Llewellyn

I understand that something that looks simple can have great impact (someting I always facing in mu daily work). It was mor a suggestion for the Joomla 4 version. This because that should be the main focus (als it is also).

If you like I can make a small movie with the steps. But let's talk about that offline. For now I know how to solve it when I'm facing this issue.

Hello @Llewellyn I understand that something that looks simple can have great impact (someting I always facing in mu daily work). It was mor a suggestion for the Joomla 4 version. This because that should be the main focus (als it is also). If you like I can make a small movie with the steps. But let's talk about that offline. For now I know how to solve it when I'm facing this issue.
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#960
No description provided.