
Product Extra Tabs infinite backup copies
One issue comes with PrestaShop module Product Extra Tabs (which is very useful by the way, because give you the opportunity to add extra tabs to any products, more than default PS tabs).
For your info, here is the module page on Prestashop add-ons and here is the page from developer, Presteamshop.com
I recently found in folder ..\override\controllers\admin\templates\products\ many files – in fact around 300 – with filename starting with “tabs.tpl_BK-PET-PTS_xxx-yy-zz” where xxx is the year, yy the month, zz the day.
Very annoying. Probably if I will not observed this in 3 years will create more than 1.000 such backup copies…
For your knowledge, the version of module is 2.2.2 for PrestaShop 1.6 and most probably an nulled one (I think customers who paid for it get updates and the problem dissapear). Anyway, I feel better to share with you this.
I have deleted most of the files found on folder “..\override\controllers\admin\templates\products\” trying to replicate de issue. Screen capture bellow.
After that I have refreshed the page / reloaded the website (doesn’t matter which page you are in) and the file tabs.tpl appeared in the folder; but not (YET) the backup copy.
Bellow is an capture where we can see the new file created.
I have made an comparison (Total Commander) and as u can see in the picture bellow, the file is an identical copy of the one located in “\modules\productextratabs\public\ override\controllers\admin\templates\products\”
I refresh the page again and now another file was created, this time an backup copy, named “tabs.tpl_BK-PET-PTS_2022-01-16” and of course, with date of today – 2022.01.16
Let see where is the cause.
On file \modules\productextratabs\productextratabs.php I have found some statements which can give us the clues:
if (!$this->core->existOverride($override, ‘/KEY_’.$this->prefix_module.’_’.$this->version.’/’)) {
rename(
_PS_ROOT_DIR_.’/’.$override,
_PS_ROOT_DIR_.’/’.$override.’_BK-‘.$this->prefix_module.’-PTS_’.date(‘Y-m-d’)
);
.. they are at the begining of function
public function __construct()
Looking for this function (the existOverride) I see that is called only 2 times in above mention file and is defined in \modules\productextratabs\classes\ ProductExtraTabsCore.php. So, the function is related only to this module.
Going back to file productextratabs.php I have commented the:
/*rename(
_PS_ROOT_DIR_.’/’.$override,
_PS_ROOT_DIR_.’/’.$override.’_BK-‘.$this->prefix_module.’-PTS_’.date(‘Y-m-d’)
);*/
as in picture bellow, and not it stops creating those infinite backup copies of tabs.tpl.
BUT if I delete the tabs.tpl, this one is re-created, which is fine.
That’s it, I hope it helps someone.