Regression 3.7: last template style preview not working #1#13775
Regression 3.7: last template style preview not working #1#13775wilsonge merged 5 commits intojoomla:stagingfrom joeforjoomla:staging
Conversation
|
you are modifying parts of this pr #12688 please make sure you do not recreate the issue it solved. |
|
Probably it would be better fix the new code #12688 instead of reverting to the previous one that i posted |
|
It looks like you are reverting changes from several pull requests and moving back to the 3.6.5 state. Please don't do that, only make the changes needed to fix the issue. As I commented on your issue last week that function has had four separate pull requests applied to it when comparing 3.6.5 to current staging. |
|
Add line 510 `// Unset the $template reference to the last $templates[n] item cycled in the foreach above to avoid to edit the $templates array in the following assignment unset($template);` |
libraries/cms/application/site.php
Outdated
| $cache->store($templates, $cacheId); | ||
| } | ||
|
|
||
| // Unset the $template reference to the last $templates[n] item cycled in the foreach above to avoid to edit the $templates array in the following assignment |
There was a problem hiding this comment.
This should be done in the else part of the above if/else. $template isn't defined if the data is pulled out of the cache.
|
OK, I moved the check myself. This PR looks fine to me, tests please. |
|
I have tested this item ✅ successfully on 796a057 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13775. |
1 similar comment
|
I have tested this item ✅ successfully on 796a057 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13775. |
|
RTC. Thanks This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13775. |
Reference #13637
Steps to reproduce the issue
Install a new template on Joomla 3.7
Try to open the preview using the URL such as:
http://joomla37/?template=mytemplate
Expected result
The frontend uses the latest installed template named 'mytemplate'
Actual result
The default template is still used
System information (as much as possible)
The code change in site.php included in the function 'getTemplate' caused the regression.
An additional line of code 510 must be added in order to unset the reference to the array before reassigning it:
// Unset the $template reference to the last $templates[n] item cycled in the foreach above to avoid to edit the $templates array in the following assignment
unset($template);
Additional comments