[BUG]: JInstaller: :Install: File does not exist [ROOT][TMP]/install_6644fecd9b71a/site/layouts Component Update: Failed to copy site files. #1132

Open
opened 2024-05-15 18:35:06 +00:00 by jjs · 4 comments

What Happened?

I thought this was a solved bug, but I see it again.

JInstaller: :Install: File does not exist [ROOT][TMP]/install_6644fecd9b71a/site/layouts
Component Update: Failed to copy site files.

On Joomla 5.0.1 using jcb 5-alpha 1

removing the layouts from in the XML solves it temporary.

I do not see this on joomla 3.10 with jcb 3.2.2-alpha 1

Steps to reproduce the Bug

Compile a component in joomla 5 and install in Joomla 5

Which Joomla version are you compiling in?

5.1.0

Which PHP version are you compiling in?

8.3

Which Joomla versions are you targeting?

5

Which PHP version are you targeting?

not important

Which Web server is JCB running on?

Apache

Which Relational Database is JCB running on?

Mariadb

Which OS is JCB running on?

Linux ubuntu 22.04

Which JCB version are you using?

5.0.1-alpha1

Where in JCB did this issue occur?

Compilation of a component, Installation of a component

On which browsers did you encounter the issue?

Firefox

Additional Comments

No response

### What Happened? I thought this was a solved bug, but I see it again. JInstaller: :Install: File does not exist [ROOT][TMP]/install_6644fecd9b71a/site/layouts Component Update: Failed to copy site files. On Joomla 5.0.1 using jcb 5-alpha 1 removing the <folder>layouts</folder> from <files folder="site"> in the XML solves it temporary. I do not see this on joomla 3.10 with jcb 3.2.2-alpha 1 ### Steps to reproduce the Bug Compile a component in joomla 5 and install in Joomla 5 ### Which Joomla version are you compiling in? 5.1.0 ### Which PHP version are you compiling in? 8.3 ### Which Joomla versions are you targeting? 5 ### Which PHP version are you targeting? not important ### Which Web server is JCB running on? Apache ### Which Relational Database is JCB running on? Mariadb ### Which OS is JCB running on? Linux ubuntu 22.04 ### Which JCB version are you using? 5.0.1-alpha1 ### Where in JCB did this issue occur? Compilation of a component, Installation of a component ### On which browsers did you encounter the issue? Firefox ### Additional Comments _No response_
jjs added the
Bug
label 2024-05-15 18:35:06 +00:00

I Can confirm this bug. If you have a component without any layouts in site views it still adds the layouts folder to the xml of the component in the site section.

I Can confirm this bug. If you have a component without any layouts in site views it still adds the layouts folder to the xml of the component in the site section.

Create a layout (e.g. called blank)

Add the layout to any random Site View
This temporarily fixes the issue

Create a layout (e.g. called `blank`) Add the layout to any random Site View This temporarily fixes the issue
Author

Ok thanks I will try.
I'm just setting up a new environmont due to new PC.
Will report back when all is running again.

Ok thanks I will try. I'm just setting up a new environmont due to new PC. Will report back when all is running again.
Owner

This issue stems from how JCB constructs folders. It utilizes a settings JSON file that provides path instructions for folders. In Joomla 3, a specific layout dictates where every folder must be, and the same applies to Joomla 4 and 5. JCB generates all the necessary folders for a component, but the only folder it can currently reverse or remove is the actual site folder when the component lacks any site views. This results in the complete removal of all folders, not just some in the site area. Therefore, there's no mechanism to clean up empty folders. Because everything is statically created, the folders exist even if they are empty, which is likely causing the problem.

The folder structure for Joomla 5 components includes the layout folder in the root of the component. If there is no layout for a site view, this leads to issues, as you have observed.

There are two ways to address this problem:

  1. Rethink the Core Folder Creation in JCB: This approach involves dynamically building the necessary folders and updating the XML configuration accordingly, rather than creating everything statically. This seems to be the future direction for JCB.

  2. Implement a Cleaning or Purging Mechanism: This would involve parsing the extension before completion and removing all empty folders. However, simply removing empty folders is not enough. The component XML also logs these folders, so the XML configuration must be updated to reflect the absence of these folders.

The error is caused not just by the presence of empty folders, but by the fact that these folders are logged in the component XML and then found to be empty. Therefore, dynamically creating the necessary folders and updating the XML configuration accordingly seems to be the best solution.

For now, the practical solution is to either not have any site view at all or to ensure that if there is a site view, layouts are used within it. This approach follows a good design pattern, as it modularizes the code for better usability. Templates and layouts work together with site views and custom admin views, allowing for a less bloated site view code and breaking down sections into reusable blocks within layouts.

While this error is indeed frustrating, it promotes good design practices. In our projects, we always use layouts, so this issue might not be resolved immediately. However, we acknowledge the problem and will address it in due course. Thank you for bringing this to our attention. We will revisit this issue in the future.

This issue stems from how JCB constructs folders. It utilizes a settings JSON file that provides path instructions for folders. In Joomla 3, a specific layout dictates where every folder must be, and the same applies to Joomla 4 and 5. JCB generates all the necessary folders for a component, but the only folder it can currently reverse or remove is the actual site folder when the component lacks any site views. This results in the complete removal of all folders, not just some in the site area. Therefore, there's no mechanism to clean up empty folders. Because everything is statically created, the folders exist even if they are empty, which is likely causing the problem. The folder structure for Joomla 5 components includes the layout folder in the root of the component. If there is no layout for a site view, this leads to issues, as you have observed. There are two ways to address this problem: 1. **Rethink the Core Folder Creation in JCB**: This approach involves dynamically building the necessary folders and updating the XML configuration accordingly, rather than creating everything statically. **This seems to be the future direction for JCB**. 2. **Implement a Cleaning or Purging Mechanism**: This would involve parsing the extension before completion and removing all empty folders. However, simply removing empty folders is not enough. The component XML also logs these folders, so the XML configuration must be updated to reflect the absence of these folders. The error is caused not just by the presence of empty folders, but by the fact that these folders are logged in the component XML and then found to be empty. Therefore, dynamically creating the necessary folders and updating the XML configuration accordingly seems to be the best solution. For now, the practical solution is to either not have any site view at all or to ensure that if there is a site view, **layouts are used within it**. This approach follows a good design pattern, as it modularizes the code for better usability. Templates and layouts work together with site views and custom admin views, allowing for a less bloated site view code and breaking down sections into reusable blocks within layouts. While this error is indeed frustrating, it promotes good design practices. In our projects, we always use layouts, so this issue might not be resolved immediately. However, we acknowledge the problem and will address it in due course. Thank you for bringing this to our attention. We will revisit this issue in the future.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#1132
No description provided.