Sometimes it compiles correctly and sometimes it doesn't #736

Closed
opened 2021-04-29 17:50:30 +00:00 by kevincam3 · 4 comments
kevincam3 commented 2021-04-29 17:50:30 +00:00 (Migrated from github.com)

Steps to reproduce the issue

After component was built I run the compilier

Expected result

full zip file

Actual result

zip file is missing the xml file.

System information (as much as possible)

  • OS Name & Version: Linux Ubuntu 18.04
  • MySql Version: 5.7.14
  • Apache Version: 2.4.25
  • PHP Version: 7.2.7
  • Joomla Version: 3.9.26
  • JCB Version: 2.12.9
  • Browser: Chrome 90.0.4430.93 (Official Build) (64-bit)

Additional comments

It compiles corrrectly sometimes and sometimes it doesn't. I noticed if I run the debugger and stop it right before the zip file is created in the code, I can see all the files are there

Line 2724 in administrator/components/com_componentbuilder/helpers/componentbuilder.php

Even when the debugger is stopped immediately after the zip is created the files seem to always be there and in the zip. I tried stopping the debugger by adding an exit() and the files are there. But when I let the code just run, some times the xml is there in the final zip and sometimes it's not.

I did another test where I commented out the lines of code that delete the temporary files created.
lines 1092 - 1096 in file administrator/components/com_componentbuilder/helpers/compiler.php

What I noticed was that the times when the xml file was not in the final zip it was still in the temp folder located here: administrator/components/com_componentbuilder/compiler

So it seems as though the zip process is not consistent because all the files are always present.

### Steps to reproduce the issue After component was built I run the compilier ### Expected result full zip file ### Actual result zip file is missing the xml file. ### System information (as much as possible) - OS Name & Version: Linux Ubuntu 18.04 - MySql Version: 5.7.14 - Apache Version: 2.4.25 - PHP Version: 7.2.7 - Joomla Version: 3.9.26 - JCB Version: 2.12.9 - Browser: Chrome 90.0.4430.93 (Official Build) (64-bit) ### Additional comments It compiles corrrectly sometimes and sometimes it doesn't. I noticed if I run the debugger and stop it right before the zip file is created in the code, I can see all the files are there Line 2724 in administrator/components/com_componentbuilder/helpers/componentbuilder.php Even when the debugger is stopped immediately after the zip is created the files seem to always be there and in the zip. I tried stopping the debugger by adding an exit() and the files are there. But when I let the code just run, some times the xml is there in the final zip and sometimes it's not. I did another test where I commented out the lines of code that delete the temporary files created. lines 1092 - 1096 in file administrator/components/com_componentbuilder/helpers/compiler.php What I noticed was that the times when the xml file was not in the final zip it was still in the temp folder located here: administrator/components/com_componentbuilder/compiler So it seems as though the zip process is not consistent because all the files are always present.

Hi Kevin, been a while since I last heard from you... welcome back. Trust your doing well 👍

Please use Firefox to build extensions, as it has many times been discovered that Chrome has strange behaviors that effect the compiler. So please test in Firefox and let me know if the issue continues...

Reading your additional comments I wonder if there is a case that the zip is still being build when the files gets removed. We could move the deletion of the files to the end... or even further away from the zip event. Strange that it would do that since PHP is not really able to do multi threading.

So two things here... work with Firefox and see it the issue continues, once we know it is not browser related we can look at the compiler events... and see if we should move any forward.

Hi Kevin, been a while since I last heard from you... welcome back. Trust your doing well :+1: Please use Firefox to build extensions, as it has many times been discovered that Chrome has strange behaviors that effect the compiler. So please test in Firefox and let me know if the issue continues... Reading your additional comments I wonder if there is a case that the zip is still being build when the files gets removed. We could move the deletion of the files to the end... or even further away from the zip event. Strange that it would do that since PHP is not really able to do multi threading. So two things here... work with Firefox and see it the issue continues, once we know it is not browser related we can look at the compiler events... and see if we should move any forward.
kevincam3 commented 2021-04-29 21:33:38 +00:00 (Migrated from github.com)

Yeah,

I know it's been awhile because I've been spending a lot of time messing with Vue/Nuxt and haven't had a lot of clients where I needed to build components from scratch but I have one now so I'm back.

Your suggestion seems to be correct. I rebuilt the component some 10 times in Firefox and no problems I went back to Chrome and on the first try it did it again. So yeah looks like it's something chrome is doing.

One thing I can't seem to time in the Wiki/docs or the videos is how to add my own code in the JTables Check() function since I'm doing an API and need to do the validation check at the database/table level. Is that possible with JCB?

Yeah, I know it's been awhile because I've been spending a lot of time messing with Vue/Nuxt and haven't had a lot of clients where I needed to build components from scratch but I have one now so I'm back. Your suggestion seems to be correct. I rebuilt the component some 10 times in Firefox and no problems I went back to Chrome and on the first try it did it again. So yeah looks like it's something chrome is doing. One thing I can't seem to time in the Wiki/docs or the videos is how to add my own code in the JTables Check() function since I'm doing an API and need to do the validation check at the database/table level. Is that possible with JCB?

Happy to hear you got that issue sorted... please do not cross issue boundaries... since other looking for answers will not find it. Next time please post a question in the https://github.com/vdm-io/Joomla-Component-Builder/discussions area as it is the new JCB forum...

Okay so the JTable is a class that we extend for the edit views which has a check method which we do not target from the JCB GUI at this time. So you will need to use some custom code...

Happy to hear you got that issue sorted... please do not cross issue boundaries... since other looking for answers will not find it. Next time please post a question in the https://github.com/vdm-io/Joomla-Component-Builder/discussions area as it is the new JCB forum... Okay so the [JTable is a class](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/tables/field.php#L22) that we extend for the edit views which has a [check method](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/tables/field.php#L134) which we do not target from the JCB GUI at this time. So you will need to use some [custom code](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=31)...

But if we see that this area has great potential for custom code... I could add another are in the GUI for it. How often do you need to target this area?

But if we see that this area has great potential for custom code... I could add another are in the GUI for it. How often do you need to target this area?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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