No Code Attached Yet
avatar costafrancesco94
costafrancesco94
13 Jan 2022

I recently tried to build my custom Docker Joomla image, and I may have discovered some bug in build files: a lot of js/css resources are pointing to files that are not present.

Steps to reproduce the issue

JOOMLA_VERSION=4.0.5
DOWNLOAD_FILENAME="/home/${APACHE_USER_NAME}/joomla_release.tar.bz2"
DOWNLOAD_SOURCE="https://github.com/joomla/joomla-cms/releases/download/${JOOMLA_VERSION}/Joomla_${JOOMLA_VERSION}-Stable-Full_Package.tar.bz2"
curl -o "$DOWNLOAD_FILENAME" -SL "$DOWNLOAD_SOURCE"
tar -C /joomla -xaf "$DOWNLOAD_FILENAME"
# Starting Apache2 server with VirtualHost on /joomla
# Install Joomla, everything run fine
# Access administrator interface

Expected result

Admin interface run fine

Actual result

Very much pages have inusable function becouse of missing .JS files (and also horrible looking due to .CSS files missing too)

System information (as much as possible)

  • I'm sure downloaded packages is OK (checksum ok)
  • I'm sure file permission are in order
  • I'm sure extracting gone well (files are not in package)
  • Files are found in similar path

Some missing files (tried to adjust with docker volume mount)

- /server/joomla/test/4/0/5/media/system/js/joomla-toolbar-button-es5.min.js:/joomla/media/system/js-toolbar-button.min.js
 - /server/joomla/test/4/0/5/media/system/js/fields/joomla-field-subform-es5.min.js:/joomla/media/system/js/fields-field-subform.min.js
 - /server/joomla/test/4/0/5/media/vendor/joomla-custom-elements/js/joomla-tab-es5.min.js:/joomla/media/vendor-custom-elements/js-tab.min.js

 - /server/joomla/test/4/0/5/media/system/css/fields/joomla-media-select.min.css:/joomla/media/system/css/fields-media-select.min.css
 - /server/joomla/test/4/0/5/media/system/js/fields/joomla-media-select-es5.min.js:/joomla/media/system/js/fields-media-select.min.js

 - /server/joomla/test/4/0/5/media/system/css/fields/joomla-field-media.min.css:/joomla/media/system/css/fields-field-media.min.css
 - /server/joomla/test/4/0/5/media/system/js/fields/joomla-field-media-es5.min.js:/joomla/media/system/js/fields-field-media.min.js

 - /server/joomla/test/4/0/5/media/system/css/fields/joomla-field-permissions.min.css:/joomla/media/system/css/fields-field-permission.min.css
 - /server/joomla/test/4/0/5/media/system/js/fields/joomla-field-permissions-es.min.js:/joomla/media/system/js/fields-field-permissions.min.js

 - /server/joomla/test/4/0/5/media/system/js/core-es5.min.js:/joomla/media/system/js-core-loader.min.js

Additional comments

I tried also with 4.0.4 version, same errors....

Most of functions works again once files are found and "corrected"

Another error appear on /joomla/media/system/js/fields-media-select.min.js: firefox console say Uncaught ReferenceError: regeneratorRuntime is not defined fields-media-select.min.js:1:1950

Also this seems to be a build error

If pointed out where to put hands I may prepare a PR

avatar costafrancesco94 costafrancesco94 - open - 13 Jan 2022
avatar costafrancesco94 costafrancesco94 - change - 13 Jan 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 13 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Jan 2022
avatar costafrancesco94
costafrancesco94 - comment - 13 Jan 2022

Update:

tested same thing in 4.0.6-rc2: same errors.

Tested out 4.1.0-beta3: NO STYLE PRESENT! (page are completely without style)

I then tried to build a Joomla instance from source (repository instructions) with build commands in the 4.0-dev branch, and there all resources are working perfectly

Is there any command to re-build resources without having to download the git repository?

avatar costafrancesco94 costafrancesco94 - change - 13 Jan 2022
The description was changed
avatar costafrancesco94 costafrancesco94 - edited - 13 Jan 2022
avatar alikon
alikon - comment - 13 Jan 2022

pretty sure something is going wrong on your dockerfile...

avatar dgrammatiko
dgrammatiko - comment - 13 Jan 2022

What exactly did you downloaded? The git repo IS NOT DIRECTLY INSTALLABLE you need to do a composer install followed by an npm install. If you're looking for installable packages try the releases or the nigtlies

avatar costafrancesco94
costafrancesco94 - comment - 14 Jan 2022

What exactly did you downloaded? The git repo IS NOT DIRECTLY INSTALLABLE you need to do a composer install followed by an npm install. If you're looking for installable packages try the releases or the nigtlies

I downloaded the relase package .tar.bz2 and doublechecked checksum

If I clone the repository and do all the necessary dev part it's working like a charm... I was talking about the relase package....

pretty sure something is going wrong on your dockerfile...

I will test same action in a normal server, but I expect same result if files are not in the archive...
Is there any other script to run other then put files in a folder like always?
I run the installation process manually, maybe there are some build processes that may have failed there? J3 did not have that (assets come up compiled in the place they should have gone)

avatar brianteeman
brianteeman - comment - 14 Jan 2022

I have manually downloaded the file from https://github.com/joomla/joomla-cms/releases/download/4.0.5/Joomla_4.0.5-Stable-Full_Package.tar.bz2 and verified that all the files are as expected.

avatar richard67
richard67 - comment - 14 Jan 2022

Update:

tested same thing in 4.0.6-rc2: same errors.

Tested out 4.1.0-beta3: NO STYLE PRESENT! (page are completely without style)

You just exchanged the files when switching between 4.0.6-rc2 and 4.1.0-beta3? If so, then this cannot work. There are database changed between 4.0 and 4.1, and one of them is a template style parameter which makes the changed templates in 4.1 (they support child templates in 4.1) find their assets at the new place (which also has changed in 4.1 because of child templates).

avatar dgrammatiko
dgrammatiko - comment - 14 Jan 2022

What @richard67 wrote!

avatar costafrancesco94
costafrancesco94 - comment - 14 Jan 2022

Ok I understand this may seems to be a newbee problem, but I assure you it is not....

Tried with a normal server: all fine.

Thanks @brianteeman that have checked build files are in correct place (since I don't know where they are supposed to be)

The problem I experience is that files are in correct position, but Joomla give back wrong URL to access them..

After some time at debug
The problem I found is hidden inside convertToRelativePath inside Joomla\CMS\HTML\HTMLHelper, wich remove the JPATH_ROOT string from the name of the file.

Becouse of my dockerfile, my JPATH_ROOT is /joomla and this is causing assets that have /joomla in their name, to change URL

$path = '/joomla/media/system/images/joomla-favicon.svg'

// function convertToRelativePath
$relativeFilePath = Uri::root(true) . str_replace(JPATH_ROOT, '', $path);

// $relativeFilePath = /media/system/images-favicon.svg

So as @alikon said, problem with specific config.

Maybe the name of my JPATH_ROOT was not so good, but maybe we should write that somewhere (maybe here? https://downloads.joomla.org/technical-requirements#footnote-apache)

avatar richard67 richard67 - change - 14 Jan 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-01-14 17:46:14
Closed_By richard67
avatar richard67 richard67 - close - 14 Jan 2022
avatar richard67
richard67 - comment - 14 Jan 2022

Closing as having a pull request. Thanks @costafrancesco94 .

Add a Comment

Login with GitHub to post a comment