No Code Attached Yet bug
avatar manuelkling
manuelkling
8 Sep 2022

Steps to reproduce the issue

Create a child template.

Expected result

It creates the same media folders that the parent is using at media/templates/site/foo and defined in templateDetails.xml.

Actual result

It creates the media folders (css, images, js, scss) and the file folder (html) from cassiopeia, even if i create a child of another template.
If i create a child from cassiopeia it still should not create the html folder in the media path (media/templates/site/cassiopeia) but in the template path (templates/cassiopeia).

System information

Joomla 4.2.2.
PHP 8.0.22

avatar manuelkling manuelkling - open - 8 Sep 2022
avatar joomla-cms-bot joomla-cms-bot - change - 8 Sep 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Sep 2022
avatar manuelkling manuelkling - change - 8 Sep 2022
The description was changed
avatar manuelkling manuelkling - edited - 8 Sep 2022
avatar manuelkling
manuelkling - comment - 9 Sep 2022

The folder creation is static in the TemplateModel and not looking for the parents templateDetails.xml settings:

// Media folder
$media = $xml->addChild('media');
$media->addAttribute('folder', 'media');
$media->addAttribute('destination', 'templates/' . ($template->client_id === 0 ? 'site/' : 'administrator/') . $template->element . '_' . $newName);
$media->addChild('folder', 'css');
$media->addChild('folder', 'js');
$media->addChild('folder', 'images');
$media->addChild('folder', 'html');
$media->addChild('folder', 'scss');

// Create an empty media folder structure
if (
!Folder::create($toPath . '/media')
|| !Folder::create($toPath . '/media/css')
|| !Folder::create($toPath . '/media/js')
|| !Folder::create($toPath . '/media/images')
|| !Folder::create($toPath . '/media/html/tinymce')
|| !Folder::create($toPath . '/media/scss')
) {

avatar manuelkling manuelkling - change - 9 Sep 2022
The description was changed
avatar manuelkling manuelkling - edited - 9 Sep 2022
avatar manuelkling manuelkling - change - 10 Sep 2022
The description was changed
avatar manuelkling manuelkling - edited - 10 Sep 2022
avatar brianteeman
brianteeman - comment - 18 Oct 2022

Please test #38986

avatar manuelkling
manuelkling - comment - 18 Oct 2022

If i create a child from cassiopeia it still should not create the html folder in the media path (media/templates/site/cassiopeia) but in the template path (templates/cassiopeia).

This part is fixed, thanks.

It creates the media folders (css, images, js, scss) and the file folder (html) from cassiopeia, even if i create a child of another template.

It is not looking for the original folders if i create a child from another template tho.

avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment