Compiler not finishing after upgrading from JCB 3.1.12 to v3.1.15 or 3.1.17; rendering placeholder values like ###BOM### instead in the final output #978

Closed
opened 2023-02-17 20:07:26 +00:00 by Obscerno · 38 comments
Member

Steps to reproduce the issue

  • Install the new version of JCB
  • Compile any component

This probably isn't that helpful but I can't not reproduce the issue.

Expected result

Components will compile normally.

Actual result

Components compile with placeholder values. For example:

  • ###BOM###
  • ###ADMIN_VIEW_CONTROLLER_HEADER###
  • class ###Component###Controller###View### extends FormController

The very first sign that something has gone wrong is that on the compile page, it gives incorrect values. For example:

  • Total folders created: ###FOLDER_COUNT###
  • Project duration: 0 weeks or ###projectMonthTime### months
  • etc.

System information (as much as possible)

  • OS Name & Version: Ubuntu 22.04.1 LTS
  • MySql Version: 10.7.4-MariaDB-1:10.7.4+maria~focal-log
  • Apache Version: 2.4.52
  • PHP Version: 8.1.2-1ubuntu2.10
  • Joomla Version: 3.10.11
  • JCB Version: v3.1.17
  • Browser: Firefox 109.0.1 (64-bit)

Additional comments

I have all of the Componentbuilder plugins enabled, if that matters.

The component I'm testing on is extremely basic; it only has one admin view with a title, an alias, and a single text field.

I tried outputting a more complex component too, and it appears that custom code placement is also failing.

I originally had the issue upgrading from 3.1.12 to 3.1.17, so I decided to try upgrading first to v3.1.15, but I had the same issues at that version.

Let me know if there are more details I can give you.

### Steps to reproduce the issue - Install the new version of JCB - Compile any component This probably isn't that helpful but I can't *not* reproduce the issue. ### Expected result Components will compile normally. ### Actual result Components compile with placeholder values. For example: - ###BOM### - ###ADMIN_VIEW_CONTROLLER_HEADER### - class ###Component###Controller###View### extends FormController The very first sign that something has gone wrong is that on the compile page, it gives incorrect values. For example: - Total folders created: ###FOLDER_COUNT### - Project duration: 0 weeks or ###projectMonthTime### months - etc. ### System information (as much as possible) - OS Name & Version: Ubuntu 22.04.1 LTS - MySql Version: 10.7.4-MariaDB-1:10.7.4+maria~focal-log - Apache Version: 2.4.52 - PHP Version: 8.1.2-1ubuntu2.10 - Joomla Version: 3.10.11 - JCB Version: v3.1.17 - Browser: Firefox 109.0.1 (64-bit) ### Additional comments I have all of the Componentbuilder plugins enabled, if that matters. The component I'm testing on is extremely basic; it only has one admin view with a title, an alias, and a single text field. I tried outputting a more complex component too, and it appears that custom code placement is also failing. I originally had the issue upgrading from 3.1.12 to 3.1.17, so I decided to try upgrading first to v3.1.15, but I had the same issues at that version. Let me know if there are more details I can give you.
Owner

JCB does not yet run stable on PHP 8+, can you try PHP 7.4?

We are working on moving things up... and I hoped we already could say its ready. But the issues you have, I would first try a lower PHP version and see if it gets resolved.

Then check the plugins, they must be activated and linked to the compiler in JCB global options compiler tab.

Then there is the issue of making sure that all the powers classes are installed, and loading.

But first check if changing the PHP helps, and if not we will do the next few steps. I am not seeing this issue on my end, but then I have all things lined-up right.

JCB does not yet run stable on PHP 8+, can you try PHP 7.4? We are working on moving things up... and I hoped we already could say its ready. But the issues you have, I would first try a lower PHP version and see if it gets resolved. Then check the plugins, they must be activated and linked to the compiler in JCB global options compiler tab. Then there is the issue of making sure that all the powers classes are installed, and loading. But first check if changing the PHP helps, and if not we will do the next few steps. I am not seeing this issue on my end, but then I have all things lined-up right.

same problem since update to 3.1.17

use php 7.4

same problem since update to 3.1.17 use php 7.4

when compiling your Demo project everything works fine but my own component show only the placeholders!

its just a project like your demo!

when compiling your Demo project everything works fine but my own component show only the placeholders! its just a project like your demo!
Owner

I am not sure if his will make a difference but I know I fixed a PHP notice, that is related to the placeholders, so lets see.

Go tho this file and remove the & from the function arguments.

So that it will look like this:

public function update(string $data, array $placeholder, int $action = 1): string

I noticed this warning message and so I fixed a few days ago, but I am not sure if this will have any effect.

I am about to release v3.1.18 with a few bug fixes I made over the last week, nothing major. But if we could get more info on where this breaks it could be part of that release.

I have many projects and they all work as expected so I am still not sure I know what causes this.

I am not sure if his will make a difference but I know I fixed a PHP notice, that is related to the placeholders, so lets see. Go tho this [file](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php) and remove the [& from the function arguments](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php#L371). So that it will look like this: ``` public function update(string $data, array $placeholder, int $action = 1): string ``` I noticed this warning message and so I fixed a few days ago, but I am not sure if this will have any effect. I am about to release v3.1.18 with a few bug fixes I made over the last week, nothing major. But if we could get more info on where this breaks it could be part of that release. I have many projects and they all work as expected so I am still not sure I know what causes this.
Owner

Here is the BETA version release for testing.

Here is the [BETA](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip) version release for testing.

thank you for your response. when i remove the & from the function arguments as you described, I get a blank page. whole site doesn't work anymore. when setting the & like before site is working but problem with placeholders is still there.

thank you for your response. when i remove the & from the function arguments as you described, I get a blank page. whole site doesn't work anymore. when setting the & like before site is working but problem with placeholders is still there.

I tried your beta version. same problem

I tried your beta version. same problem

I started a fresh installation with joomla 3.10.11 and php 7.4.

First i used prior package jcb 3.1.12. Everything works fine with this constellation. I created 2 new fields which i linked to a new admin view. After setting up the new component with my own admin view, I compiled project and everything worked fine. Placeholder values are set.

Next step:
Update to jcb 3.1.17 and then I created same 2 fields, same admin view and same component then i compiled again. Now i got a working component which worked fine BUT the placeholder values are not set. (See image attached).

Further step:
I created another field and linked this new field to my existing admin view and compiled the component. Now placeholder values output from compiler is not set but I get message, that component compiling was successfull. I'm able to install compiled component but when i try to use my new component I get an ERROR: 500 (see attached screenshot). I checked following file (httpdocs/administrator/components/com_tests/views/tests/view.html.php) and there are placeholders also not replaced with values. (image attached)

Perhaps you can reproduce error with this description.

greets from austria.
Roland

I started a fresh installation with joomla 3.10.11 and php 7.4. First i used prior package jcb 3.1.12. Everything works fine with this constellation. I created 2 new fields which i linked to a new admin view. After setting up the new component with my own admin view, I compiled project and everything worked fine. Placeholder values are set. Next step: Update to jcb 3.1.17 and then I created same 2 fields, same admin view and same component then i compiled again. Now i got a working component which worked fine BUT the placeholder values are not set. (See image attached). Further step: I created another field and linked this new field to my existing admin view and compiled the component. Now placeholder values output from compiler is not set but I get message, that component compiling was successfull. I'm able to install compiled component but when i try to use my new component I get an ERROR: 500 (see attached screenshot). I checked following file (httpdocs/administrator/components/com_tests/views/tests/view.html.php) and there are placeholders also not replaced with values. (image attached) Perhaps you can reproduce error with this description. greets from austria. Roland
Owner

Since I wasn't sure how to quickly explain this, I recorded a brief demonstration of my workflow. Please review the video and let me know what you believe are the major differences between our environments.

Despite my efforts, I was unable to see the errors you mentioned. Here is the link to the video:
image

If I could see the issue, I would fix it. Perhaps by sharing my workflow, you can better understand how I approach things and how it may differ from our current workflow.

Since I wasn't sure how to quickly explain this, I recorded a brief demonstration of my workflow. Please review the video and let me know what you believe are the major differences between our environments. Despite my efforts, I was unable to see the errors you mentioned. Here is the link to [the video](https://youtu.be/4viYmknFbeQ): [![image](/attachments/55e31dc7-e339-4169-9aa8-85a4d6848994)](https://youtu.be/4viYmknFbeQ) If I could see the issue, I would fix it. Perhaps by sharing my workflow, you can better understand how I approach things and how it may differ from our current workflow.
400 KiB

you can have access to my server. its just a testserver from cloudaccess. there i try new things out.

you can have access to my server. its just a testserver from cloudaccess. there i try new things out.
Owner

I have already spent more time on this issue than is necessary. Setting up your Joomla environment in the same manner as demonstrated in the video should resolve the problem.

I have already spent more time on this issue than is necessary. Setting up your Joomla environment in the same manner as demonstrated in the video should resolve the problem.
Owner

As a side note, it is worth mentioning that JCB is best suited for use in a local/development environment with fewer restrictions. When using a production server, JCB may not work as effectively. While the components and extensions built with JCB are designed to work in production, JCB itself is intended for use in development, not production. This is largely why I created OctoJoom, which provides a unified development environment for anyone in my company who uses JCB.

OctoJoom allows for the same setup on a local Ubuntu desktop as on a Ubuntu server. This makes it the ideal development environment, which is why we have made it our primary target. However, as a community, we are not yet large enough to cater to all possible server setups.

OctoJoom If you take a look at the OctoJoom script here, you will see that a great deal of effort has gone into making it easier for developers to get started with Joomla extension development. As far as I am aware, very few Joomla extension development firms have gone to this level of effort to assist others in navigating the complex world of software development.

At present, my workload is quite heavy, so the best I can do is direct you to the resources that I use. I am unable to work with you directly, but I hope that this information is helpful.

As a side note, it is worth mentioning that JCB is best suited for use in a local/development environment with fewer restrictions. When using a production server, JCB may not work as effectively. While the components and extensions built with JCB are designed to work in production, JCB itself is intended for use in development, not production. This is largely why I created OctoJoom, which provides a unified development environment for anyone in my company who uses JCB. OctoJoom allows for the same setup on a local Ubuntu desktop as on a Ubuntu server. This makes it the ideal development environment, which is why we have made it our primary target. However, as a community, we are not yet large enough to cater to all possible server setups. OctoJoom If you take a look at the [OctoJoom script here](https://git.vdm.dev/octoleo/octojoom/src/branch/master/src/octojoom), you will see that a great deal of effort has gone into making it easier for developers to get started with Joomla extension development. As far as I am aware, very few Joomla extension development firms have gone to this level of effort to assist others in navigating the complex world of software development. At present, my workload is quite heavy, so the best I can do is direct you to the resources that I use. I am unable to work with you directly, but I hope that this information is helpful.
Author
Member

Hey, OP here! I found a workaround AND an easy way to reproduce it.

Reproducing the Error

  • Open the Demo component.
  • Go to the "Dynamic Integration" tab.
  • Remove the text and set "Add Update Server" to "No".
  • Save and compile!
  • Check the generated code.

Workaround

  • Go to the "Dynamic Integration" tab.
  • Set "Add Update Server" to "Yes".
  • Add any text. "test" worked for me.
  • Save and compile!

I don't know if having http://test is a security issue. There's no top-level domain so I don't see how it could be, but I might use custom code to remove the <updateservers> XML anyway.

Bonus!

The above fixes the output of the code (which is the important part), but does not fix the placeholders on the compile page when listing the total time saved.

To reproduce/workaround this, just remove/add "Read Me" text in the same way.


In any event, I'll try to figure out OctoJoom so next time I can be more helpful.

Hey, OP here! I found a workaround AND an easy way to reproduce it. ### Reproducing the Error - Open the Demo component. - Go to the "Dynamic Integration" tab. - Remove the text and set "Add Update Server" to "No". - Save and compile! - Check the generated code. ### Workaround - Go to the "Dynamic Integration" tab. - Set "Add Update Server" to "Yes". - Add any text. "test" worked for me. - Save and compile! I don't know if having http://test is a security issue. There's no top-level domain so I don't see how it could be, but I might use custom code to remove the `<updateservers>` XML anyway. ### Bonus! The above fixes the output of the code (which is the important part), but does not fix the placeholders on the compile page when listing the total time saved. To reproduce/workaround this, just remove/add "Read Me" text in the same way. ----- In any event, I'll try to figure out OctoJoom so next time I can be more helpful.
Owner

Okay, so I tried this, and I still get a complete well build component.

Here is my suspicion, I am wondering if the issue is not related to partial upgrades. I mean All the issues look like files missing, and file not changed. Almost like if you would manually delete the files before installing JCB again, you may have resolved your issue.

Now there are some files needed for JCB to "update" and they are all found in this folder. You can delete all other JCB files manually and be able to upgrade JCB without losing your database values.

So going to the library folder and delete this folder: Componentbuilder. Then in the admin area delete this folder: compiler Also delete these folders: controllers and models

Then install JCB with this link: https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip

Honestly I don't know what this is happening, but it really looks like the old files are not updated.

For example, the files that builds the placeholders for the numbers is found here:

I have looked over these lines and there is absolutely no reason for them not to work. So on you system, are these files the same, as seen on this repository?

Okay, so I tried this, and I still get a complete well build component. Here is my suspicion, I am wondering if the issue is not related to partial upgrades. I mean All the issues look like files missing, and file not changed. Almost like if you would manually delete the files before installing JCB again, you may have resolved your issue. Now there are some files needed for JCB to "update" and they are all found in [this folder](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Utilities). You can delete all other JCB files manually and be able to upgrade JCB without losing your database values. So going to the library folder and delete this [folder: Componentbuilder](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder). Then in the admin area delete this [folder: compiler](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler) Also delete these folders: [controllers](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/controllers) and [models](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/models) Then install JCB with this link: https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip Honestly I don't know what this is happening, but it really looks like the old files are not updated. For example, the files that builds the placeholders for the numbers is found here: - [controllers/compiler.ph](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/controllers/compiler.php#L260) - [libraries/.../Counter](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Counter.php#L313) - [helpers/compiler.php](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler.php#L871) I have looked over these lines and there is absolutely no reason for them not to work. So on you system, are these files the same, as seen on this repository?
Owner

So just so you understand, don't delete any of the files in the utility folder found here, since they are needed during upgrade of JCB. But all other files on the file system related to JCB can actually be removed.

Should we find that this is the issue, I will add a script to remove all files that should be updated with each update, to kinda force this to happen. Since this seems like a outdated files issue.

So just so you understand, don't delete any of the files in the [utility folder found here](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Utilities), since they are needed during upgrade of JCB. But all other files on the file system related to JCB can actually be removed. Should we find that this is the issue, I will add a script to remove all files that should be updated with each update, to kinda force this to happen. Since this seems like a outdated files issue.
Author
Member

Okay I've done exactly as you said, and some unused files were removed but there were no changes to the code in the remaining files. Unfortunately, I still get the same result. :/

I can confirm that those three files are exactly the same as on the repository.

Just to make sure: did you delete the update server text before setting "Add Update Server" to no? I've just tested it, and if there is text in the update_server_url field it still compiles properly even if add_update_server is set to no.

(actually I just messed around with it more and you don't even need to toggle "Add Update Server", you only need to remove the url text and save. Sorry for the confusion)

If you did delete that text, or if you try it and it still doesn't work, what I'll do is figure out OctoJoom and get back to you when I've figured out how to replicate it in your environment and record a video.

Okay I've done exactly as you said, and some unused files were removed but there were no changes to the code in the remaining files. Unfortunately, I still get the same result. :/ I can confirm that those three files are exactly the same as on the repository. Just to make sure: did you delete the update server text before setting "Add Update Server" to no? I've just tested it, and if there is text in the `update_server_url` field it still compiles properly even if `add_update_server` is set to no. *(actually I just messed around with it more and you don't even need to toggle "Add Update Server", you only need to remove the url text and save. Sorry for the confusion)* If you did delete that text, or if you try it and it still doesn't work, what I'll do is figure out OctoJoom and get back to you when I've figured out how to replicate it in your environment and record a video.
Author
Member

If removing the url text does work, visiting the looks page should give an error like:

View class not found [class, file]: demoViewlooks, /var/www/html/joomla/administrator/components/com_demo/views/looks/view.html.php

If removing the url text does work, visiting the looks page should give an error like: > View class not found [class, file]: demoViewlooks, /var/www/html/joomla/administrator/components/com_demo/views/looks/view.html.php

so following your suggest to use octojoom i actually installed latest ubuntu on a testcomputer and docker incl composer.

after that i installed octojoom with copied commands from your rep.

everything worked fine but when i try to start octojoom i get the error that docker composer is missing although i have latest version installed?!

ubuntu 22.04 lts

so following your suggest to use octojoom i actually installed latest ubuntu on a testcomputer and docker incl composer. after that i installed octojoom with copied commands from your rep. everything worked fine but when i try to start octojoom i get the error that docker composer is missing although i have latest version installed?! ubuntu 22.04 lts
Owner

You must install things this way:

sudo apt update

sudo mkdir -p /etc/apt/keyrings &&
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg &&
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  
sudo apt-get update && sudo apt-get upgrade -y

sudo apt-get remove docker \
    docker-engine \
    docker.io \
    containerd \
    runc
sudo apt-get install docker-ce docker-ce-cli containerd.io -y

sudo curl -SL https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

sudo chmod 0755 /usr/local/bin/docker-compose && sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

sudo groupadd docker

sudo usermod -aG docker $USER

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

I should actually add these option to the script, but that means we need docker-compose installed as a binary.

You must install things this way: ``` sudo apt update sudo mkdir -p /etc/apt/keyrings && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update && sudo apt-get upgrade -y sudo apt-get remove docker \ docker-engine \ docker.io \ containerd \ runc sudo apt-get install docker-ce docker-ce-cli containerd.io -y sudo curl -SL https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose sudo chmod 0755 /usr/local/bin/docker-compose && sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose sudo groupadd docker sudo usermod -aG docker $USER sudo systemctl enable docker.service sudo systemctl enable containerd.service ``` I should actually add these option to the script, but that means we need docker-compose installed as a binary.
Owner

I just updated OctoJoom to better handle this. TO update your version just run:

octojoom --update

Then it should be able to install docker and docker-compose for you if not found.

I just [updated OctoJoom](https://git.vdm.dev/octoleo/octojoom/commit/ea1ff59177a54644e1af823cff9fcb9f80f2889a) to better handle this. TO update your version just run: ``` octojoom --update ``` Then it should be able to install docker and docker-compose for you if not found.

actually i set up octojoom, which now is working. so i will tryout jcb with this environment.
i wanna say thank you for your tremendous support!

actually i set up octojoom, which now is working. so i will tryout jcb with this environment. i wanna say thank you for your tremendous support!
Author
Member

Okay I set up octojoom with the same Joomla version tag you used in your video, and reproduced the issue with a plain install of JCB 3.1.17, only modifying the Demo component.

I recorded a video of it for you here: https://www.youtube.com/watch?v=6AmRIR8gQdw

Okay I set up octojoom with the same Joomla version tag you used in your video, and reproduced the issue with a plain install of JCB 3.1.17, only modifying the Demo component. I recorded a video of it for you here: https://www.youtube.com/watch?v=6AmRIR8gQdw

So i just tested in octojoom. i setup system like described but I also get the same error.

First everything works fine but suddenly (when i change something after first compiling of my project) placeholders are not replaced with values and when I install this new component I get an error:500

So i just tested in octojoom. i setup system like described but I also get the same error. First everything works fine but suddenly (when i change something after first compiling of my project) placeholders are not replaced with values and when I install this new component I get an error:500

Workaround

  • Go to the "Dynamic Integration" tab.
  • Set "Add Update Server" to "Yes".
  • Add any text. "test" worked for me.
  • Save and compile!

I ran into the same issues. Using this workarround I was able to successfully update my site to the current version of JCB and continue development on my component. Thanks for sharing your method.

> ### Workaround > > - Go to the "Dynamic Integration" tab. > - Set "Add Update Server" to "Yes". > - Add any text. "test" worked for me. > - Save and compile! I ran into the same issues. Using this workarround I was able to successfully update my site to the current version of JCB and continue development on my component. Thanks for sharing your method.
Owner

First everything works fine but suddenly (when i change something after first compiling of my project) placeholders are not replaced with values and when I install this new component I get an error:500

Sorry to hear that, I have from @Obscerno video spotted some bugs, and I am nearly ready to rollout a beta release to test the fixes I have made. Will update this soon...

> First everything works fine but suddenly (when i change something after first compiling of my project) placeholders are not replaced with values and when I install this new component I get an error:500 Sorry to hear that, I have from @Obscerno video spotted some bugs, and I am nearly ready to rollout a beta release to test the fixes I have made. Will update this soon...
Owner

Okay, the beta version has been updated, and you can download it from this link: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip

You can find all updates on the beta version by checking out this link: https://git.vdm.dev/joomla-beta/pkg-component-builder

Each time I fix something, I have an automated build from my JCB instance towards this beta branch (once I feel its stable enough for a larger test audience). So the version number may be irrelevant, as the next stable release may have the same version. However, this master zip file will always provide you with the latest nightly-build, or beta release as I like to call it.

By the way, I am always on this version, and have been for years. I always use the beta version of JCB, as it is constantly evolving, and staying on this branch is the best way for me to ensure that I am the first to see any issues that arise. This way, many issues never even see the light of day.

The issue with this particular case is quite an edge case, but I believe we have now resolved it in this latest beta version. Please try it out and let me know if the issue persists.

Okay, the beta version has been updated, and you can download it from this link: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip You can find all updates on the beta version by checking out this link: https://git.vdm.dev/joomla-beta/pkg-component-builder Each time I fix something, I have an automated build from my JCB instance towards this beta branch (once I feel its stable enough for a larger test audience). So the version number may be irrelevant, as the next stable release may have the same version. However, this master zip file will always provide you with the latest nightly-build, or beta release as I like to call it. By the way, I am always on this version, and have been for years. I always use the beta version of JCB, as it is constantly evolving, and staying on this branch is the best way for me to ensure that I am the first to see any issues that arise. This way, many issues never even see the light of day. The issue with this particular case is quite an edge case, but I believe we have now resolved it in this latest beta version. Please try it out and let me know if the issue persists.

I've got the same error, but not related to the dynamic server. It was related to a custom field (I think). Only difference I was not able to get rid of the error. I've deleted almost everything from the component (keeping just one admin view, very very basic) but I was unable to get out of the error.

I've trashed and restarted the component from scratch three times. The third time I added a field per time, compiled, installed and checked. It seems it was a custom field referring to a missed field.

Like you I'm working on a online site as my local hd crashed...

I've got the same error, but not related to the dynamic server. It was related to a custom field (I think). Only difference I was not able to get rid of the error. I've deleted almost everything from the component (keeping just one admin view, very very basic) but I was unable to get out of the error. I've trashed and restarted the component from scratch three times. The third time I added a field per time, compiled, installed and checked. It seems it was a custom field referring to a missed field. Like you I'm working on a online site as my local hd crashed...
Owner

Deleting stuff is almost never the solution, just un-link the fields, and then the views... until it builds again, and then you should see where the issue really is.

I don't think I have ever deleted any view or field I ever created, my one system has over 3 000 fields, and 300 admin views.

The instability your describing is just not real in my world, and I use JCB everyday for many years now.

Deleting stuff is almost never the solution, just un-link the fields, and then the views... until it builds again, and then you should see where the issue really is. I don't think I have ever deleted any view or field I ever created, my one system has over 3 000 fields, and 300 admin views. The instability your describing is just not real in my world, and I use JCB everyday for many years now.

I meant I deleted the "component" record (in JCB components view) and remade it. Un-linking everything didn't work, still the issue come up, like a "template" was saved by JCB and reused it. I know it doesn't make sense but the feeling was that. Obviously I deleted manually the files from server too, to be sure fresh one were installed but without success. So, the only thing I could do at that point was start a new "component" record and link again everything step by step.
I've just finished to add all the configuration's fields and now I started to link the (admin) views and check all files are there.

I meant I deleted the "component" record (in JCB components view) and remade it. Un-linking everything didn't work, still the issue come up, like a "template" was saved by JCB and reused it. I know it doesn't make sense but the feeling was that. Obviously I deleted manually the files from server too, to be sure fresh one were installed but without success. So, the only thing I could do at that point was start a new "component" record and link again everything step by step. I've just finished to add all the configuration's fields and now I started to link the (admin) views and check all files are there.
Robot referenced this issue from a commit 2023-02-27 09:43:15 +00:00
Robot referenced this issue from a commit 2023-02-27 12:28:17 +00:00
Author
Member

Okay, the beta version has been updated, and you can download it from this link: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip

Hi @Llewellyn, I've just checked this out! The read-me bug is fixed, and the empty "Update Server" url is also fixed. Thank you so much!

BUT, I still get the bug if the "Update Server" url is empty AND "Add Update Server" is set to no. :(

I've recorded a new video for reproducing it here: https://youtu.be/7mkX7YrYaB0

This is the default configuration for new components, so it will probably still be a common problem for people who don't set that field. Until then, a workaround is again to add "test" in the "Update Server" url field. Then set "Add Update Server" to "No".

Thanks again for all your work on this @Llewellyn.

> Okay, the beta version has been updated, and you can download it from this link: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip Hi @Llewellyn, I've just checked this out! The read-me bug is fixed, and the empty "Update Server" url is also fixed. Thank you so much! BUT, I still get the bug if the "Update Server" url is empty **AND "Add Update Server" is set to no**. :( I've recorded a new video for reproducing it here: https://youtu.be/7mkX7YrYaB0 This is the default configuration for new components, so it will probably still be a common problem for people who don't set that field. Until then, a workaround is again to add "test" in the "Update Server" url field. Then set "Add Update Server" to "No". Thanks again for all your work on this @Llewellyn.
Owner

Please try the following, on line 798 to 808 add the following:

// catch empty URL to update server TODO: we need to fix this in  better way later
if (empty($component->add_update_server) || ($component->add_update_server == 1 && $component->update_server_target !== 3
	&& (
		!StringHelper::check($component->update_server_url)
		|| strpos($component->update_server_url, 'http') === false
	)))
{
	// we fall back to other, since we can't work with an empty update server URL
	$component->add_update_server = 0;
	$component->update_server_target = 3;
	$component->update_server_url = '';
}

This should fix this issue.

Please try the following, on line [798 to 808](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Data.php#L798-L808) add the following: ``` // catch empty URL to update server TODO: we need to fix this in better way later if (empty($component->add_update_server) || ($component->add_update_server == 1 && $component->update_server_target !== 3 && ( !StringHelper::check($component->update_server_url) || strpos($component->update_server_url, 'http') === false ))) { // we fall back to other, since we can't work with an empty update server URL $component->add_update_server = 0; $component->update_server_target = 3; $component->update_server_url = ''; } ``` This should fix this issue.
Author
Member

This should fix this issue.

That did indeed fix it! Thanks @Llewellyn. I can't reproduce the issue anymore.

> This should fix this issue. That did indeed fix it! Thanks @Llewellyn. I can't reproduce the issue anymore.

I know this issue has been closed for 2 days, I couldn't test before.

Unfortunately I get the same problem.

I also upgraded from JCB 3.1.12 to 3.1.19 and when I compile my component, all my views (admin & site) are the starting with ###BOM### and ending with ###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT###

According to the compilation warnings, there is about 30 Custom Code Warning... what is not really surprising.
But even if I correct one of two custom codes, it doesn't change anything, I still get the ###BOM### instead of getting the expected output.
I change as well from PHP 8.1 to PHP 7.4, but also that doesn't change anything.

I tried with the Demo component and this seams to work.

I know this issue has been closed for 2 days, I couldn't test before. Unfortunately I get the same problem. I also upgraded from JCB 3.1.12 to 3.1.19 and when I compile my component, all my views (admin & site) are the starting with `###BOM###` and ending with `###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT###` According to the compilation warnings, there is about 30 Custom Code Warning... what is not really surprising. But even if I correct one of two custom codes, it doesn't change anything, I still get the ###BOM### instead of getting the expected output. I change as well from PHP 8.1 to PHP 7.4, but also that doesn't change anything. I tried with the Demo component and this seams to work.

it works with JCB version 3.1.20-beta....
I didn't see the post about v3.1.20-beta
sorry again.

it works with JCB version 3.1.20-beta.... I didn't see the post about v3.1.20-beta sorry again.
Owner

If you can help debug this, that will be great.

There seems to be an issue, when you do things with JCB that "I" don't expect you to do. Things that I don't do in any of my extensions. That should be the first clue as to where to look.

Second the update of all files start in a protected function called updateFiles in the main compiler entry class.

You will see the BOM is being loaded at that moment. Then we start looping over all "static" and "dynamic" files.

These are the first value to check, if there are any files in those arrays. The class used to manage these files is called the Utilities Files class and I am thinking of changing this class, as it seems to be causing the issue. Before I change it way from a registry class, to a mapper class. Can you just go over these areas and give me so feedback as to what you see. Like does the content class have values for the view?

If you can help debug this, that will be great. There seems to be an issue, when you do things with JCB that "I" don't expect you to do. Things that I don't do in any of my extensions. That should be the first clue as to where to look. Second the update of all files start in a [protected function called updateFiles](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler.php#L381) in the main compiler entry class. You will see the [BOM](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler.php#L387) is being loaded at that moment. Then we start looping over all "[static](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler.php#L389)" and "[dynamic](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler.php#L399)" files. These are the first value to check, if there are any files in those arrays. The class used to manage these files is called the [Utilities Files class](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Files.php) and I am thinking of changing this class, as it seems to be causing the issue. Before I change it way from a registry class, to a mapper class. Can you just go over these areas and give me so feedback as to what you see. Like does the [content class](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Content.php) have [values for the view](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler.php#L401)?
Owner

it works with JCB version 3.1.20-beta....
I didn't see the post about v3.1.20-beta
sorry again.

Hmm did not see that, okay... good news, but I am thinking to still change out that class. Since the registry does not do to kind with '.' in values.

> it works with JCB version 3.1.20-beta.... > I didn't see the post about v3.1.20-beta > sorry again. Hmm did not see that, okay... good news, but I am thinking to still change out that class. Since the registry does not do to kind with '.' in values.

the best thing about v3.1.20-beta is that all 30 "Custom Code Warning" are gone!
I made a few tests with my component and the admin & the site views work without problems. This is fantastic.
I just switched to PHP 8.0, and it seams to work as well :-)
I haven't tried with Joomla! 4, but this is another topic.
Thanks a lot for your great work !

the best thing about v3.1.20-beta is that all 30 "Custom Code Warning" are gone! I made a few tests with my component and the admin & the site views work without problems. This is fantastic. I just switched to PHP 8.0, and it seams to work as well :-) I haven't tried with Joomla! 4, but this is another topic. Thanks a lot for your great work !
Owner

JCB is not yet Joomla 4 read... (and officially it still not running on PHP 8+) but I am sure it can, as I have been pushing that forward the last few months also.

I will close this again, but if this issue comes up again, your welcome to bump this again.

JCB is not yet Joomla 4 read... (and officially it still not running on PHP 8+) but I am sure it can, as I have been pushing that forward the last few months also. I will close this again, but if this issue comes up again, your welcome to bump this again.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 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#978
No description provided.