VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: coffeetogo on February 18, 2021, 10:44:31 AM

Title: Template overrride filename length
Post by: coffeetogo on February 18, 2021, 10:44:31 AM
PHP 7.4.6
VirtueMart 3.8.8 10472
Joomla! 3.9.24

Hi,

Just wanted to check on something in regards to template overrrides.

I couldn't get the overrrides to work. I created a template in the productdetails overrride folder but everytime I picked my template from the "Product Details Page" dropdown box  in a product and saved it just went back to the default.

Finally tracked down that this happens if the filename (excluding .php) is 17 characters or more. Change the filename to 16 characters or less and its fine.

Is there a limit on the length of filenames?

Thanks

D
Title: Re: Template overrride filename length
Post by: coffeetogo on February 18, 2021, 11:21:55 AM
More info as I noticed that there are long filenames using an "_". This is when the filename doesn't have an underscore i.e "1234567890123456.php". Same result in a TemplateToaster template and the VMBeez3 template.
Title: Re: Template overrride filename length
Post by: jenkinhill on February 18, 2021, 13:46:16 PM
I can't duplicate this on my server. Even this override file worked OK as an override.  defaulttemplatetestinarowoffour.php
Title: Re: Template overrride filename length
Post by: coffeetogo on February 19, 2021, 15:03:00 PM
Hi Kelvyn,

done some testing. Setup two new sites on two different hosting services. Only joomla and virtuemart installed and still get the issue with the filename length.

Tried changing the PHP level but had no effect. Not sure what else to try as I've changed nothing from the original installation other than currency.

Any thoughts appreciated.

Thanks

D
Title: Re: Template overrride filename length
Post by: Jörgen on February 19, 2021, 15:17:18 PM
What template are You using besides this homemade override ? Tried to use VMBeez and add this override ?

Jörgen
Title: Re: Template overrride filename length
Post by: coffeetogo on February 19, 2021, 15:37:43 PM
Hi Jorgen,

I get the same result on all three installled default templates (Beez, VMBeez and protostar).

The sites are just for testing this issue so if you'd like a login to see what's happening I can send you it to you.

Thanks

D
Title: Re: Template overrride filename length
Post by: jenkinhill on February 19, 2021, 16:19:40 PM
I just re-read your op and it mentions "in a product".  I apply product layout overrides in (usually) a specific category or for all products in Config/templates and can state that long filenames work OK there.  But I just tried for a single product and can confirm that a long filename is not saved there. Strange.
Title: Re: Template overrride filename length
Post by: coffeetogo on February 19, 2021, 16:32:52 PM
Hi Kelvyn,

Glad you have been able to reproduce it. Thought I was going bonkers or doing something silly.

Good to know I can use the category overide and I will just make sure the override names are short enough when I get to my miscellanious category where a number of layouts are need.

Thanks for your time and help.

Regards

D