xoops forums

irmtfan

Module Developer
Posted on: 2013/5/8 8:13
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#1

Xoops2.5.6 and xoops26 bug (important): block template file will not updated after update the module

I had this bug for many years. when i update a module and module block template file name had been changed, It will not updated. Only Altsys by GIJ could update the module block template. Finally today i found the bug in core 256 It is a very old bug unsolved for about 7 years. in xoops256/modules/system/admin/modulesadmin/main.php around line 615 one previous core developer forgot to update the tpl_file so you should add the tpl_file like this:
$tplfile_new->setVar('tpl_source'$contenttrue);
                                    
$tplfile_new->setVar('tpl_desc'$block['description'], true);
                                    
$tplfile_new->setVar('tpl_lastmodified'time());
                                    
$tplfile_new->setVar('tpl_lastimported'0);
                                    
$tplfile_new->setVar('tpl_file'$block['template'], true); // irmtfan bug fix:  block template file will not updated after update the module
                                    
if (!$tplfile_handler->insert($tplfile_new)) {
                                        
$msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">'.sprintf(_AM_SYSTEM_MODULES_TEMPLATE_UPDATE_ERROR"<strong>".$block['template']."</strong>").'</span>';
                                    } else {
I should test in Xoops26 but i think 26 has not this bug. please somebody send it to bug tracker. Edit: it is bug in xoops26 too. in modules/system/class/module.php around line 682:
$tplfile_new->setVar('tpl_source'$templatetrue);
                            
$tplfile_new->setVar('tpl_desc'$block['description'], true);
                            
$tplfile_new->setVar('tpl_lastmodified'time());
                            
$tplfile_new->setVar('tpl_lastimported'0);
                            
$tplfile_new->setVar('tpl_file'$block['template'], true); // irmtfan bug fix:  block template file will not updated after update the module

Mamba

Moderator
Posted on: 2013/5/8 8:18
Mamba
Mamba (Show more)
Moderator
Posts: 10944
Since: 2004/4/23
#2

Re: Xoops2.5.6 bug (important): block template file will not updated after update the module

Quote:
please somebody send it to bug tracker

https://sourceforge.net/p/xoops/bugs/1269/
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

irmtfan

Module Developer
Posted on: 2013/5/8 8:44
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#3

Re: Xoops2.5.6 bug (important): block template file will not updated after update the module

thanks mamba.
the bug is exist in xoops 26.
This bug will prevent module developers to change the templates files for blocks in clone process.
now they add $dirname as a prefix but it is not needed.
eg: templates/blocks/DIRNAME_counts.html
should be changed to
templates/blocks/block_counts.html
and the above will work perfectly in all clones.

I want to update the how to write standard module tutorial ASAP.

zyspec

Module Developer
Posted on: 2013/5/8 18:44
zyspec
zyspec (Show more)
Module Developer
Posts: 1077
Since: 2004/9/21
#4

Re: Xoops2.5.6 and xoops26 bug (important): block template file will not updated after update the module

Good find irmtfan! Thanks for following through to not only find the issue but propose a fix...

irmtfan

Module Developer
Posted on: 2013/5/9 2:25
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#5

Re: Xoops2.5.6 bug (important): block template file will not updated after update the module

Yes this bug really annoy me for ages. I update a module (especially you surely will face it in updating a cloned module) and see blocks templates are not updated. I did everything but only Altsys could update it.
I think i sent some similar bug reports before but nobody found it.
Im sure this is the solution.