Sometimes it compiles correctly and sometimes it doesn't #736
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)
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.
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...
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?