Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Frontend Template copy failed #28796

Closed
coolcat-creations opened this issue Apr 25, 2020 · 9 comments
Closed

[4.0] Frontend Template copy failed #28796

coolcat-creations opened this issue Apr 25, 2020 · 9 comments

Comments

@coolcat-creations
Copy link
Contributor

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

@infograf768
Copy link
Member

infograf768 commented Apr 25, 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)

@infograf768
Copy link
Member

@Bakual

@Bakual
Copy link
Contributor

Bakual commented Apr 25, 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 😄

@infograf768
Copy link
Member

infograf768 commented Apr 25, 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.

@Bakual
Copy link
Contributor

Bakual commented Apr 25, 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?

@infograf768
Copy link
Member

infograf768 commented Apr 25, 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).

@Bakual
Copy link
Contributor

Bakual commented Apr 25, 2020

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

@infograf768
Copy link
Member

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

See #26259 (comment)

@Bakual
Copy link
Contributor

Bakual commented Apr 26, 2020

Please test #28813

@Quy Quy closed this as completed Apr 26, 2020
richard67 added a commit that referenced this issue Apr 26, 2020
Pull Request for Issue #28796 and #26259.
- Adding logic to the template copy method to take care of language files in global language folder and media assets in /media
- Adjusted the templates manifest files: removing the language prefix, removing language folder from Cassiopeia, adding media folder to Atum
- Fixing the file filter to match all .ini files (it has to be regex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants