?
avatar coolcat-creations
coolcat-creations
25 Apr 2020

Steps to reproduce the issue

Same issue like here: #19420 (comment) - but it's closed and I was asked to create a new issue.

Tried to copy a template which did not work.

grafik

avatar coolcat-creations coolcat-creations - open - 25 Apr 2020
avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Apr 2020
avatar infograf768
infograf768 - comment - 25 Apr 2020

The issue is that the language folder in our Cassiopea template was taken off, which means the whole copy template code has to be modified to also check for the template language files in the core language folders, this whether copying a site or admin template.

See #23493
Specially #23493 (comment)
and
#23493 (comment)

avatar infograf768
infograf768 - comment - 25 Apr 2020
avatar richard67 richard67 - change - 25 Apr 2020
Status New Confirmed
avatar Bakual
Bakual - comment - 25 Apr 2020

I think it fails in the fixTemplateName method (

) where it tries to rename the language files.

That's where we have to change the code so it looks up the language files both in the local language folder and in the global one. For the global one, it obviously has to filter the files by template name and not just blindly copy each ini file 😄

avatar infograf768
infograf768 - comment - 25 Apr 2020

Does it not have to be first done in the copy method?

			// Copy all files from $fromName template to $newName folder
			if (!Folder::copy($fromPath, $toPath) || !$this->fixTemplateName())
			{
				return false;
			}

I.e. creating a new language folder to $toPath containing the necessary files from the core language folder, and this for every language installed.

avatar Bakual
Bakual - comment - 25 Apr 2020

The copy there just copies the whole template folder. The custom stuff is done in the fixTemplateName as it looks. Maybe it would make sense to create a new method which copies the language files if needed?

avatar infograf768
infograf768 - comment - 25 Apr 2020

Maybe it would make sense to create a new method which copies the language files if needed?

And create the folder.
That would be the easiest to maintain as it is not a 2 lines of code (every installed languages + taking care of with/without prefix).

avatar Bakual
Bakual - comment - 25 Apr 2020

I have a broad idea how it could be done. I'll try if I can do something this weekend.

avatar infograf768
infograf768 - comment - 26 Apr 2020

There are other assets to take care of, i.e. in media/templates/nameoftemplate

See #26259 (comment)

avatar Bakual
Bakual - comment - 26 Apr 2020

Please test #28813

avatar Quy Quy - change - 26 Apr 2020
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2020-04-26 14:04:14
Closed_By Quy
avatar Quy Quy - close - 26 Apr 2020

Add a Comment

Login with GitHub to post a comment