1
irmtfan
xoops256 bug (very important): template duplicate issue
  • 2013/5/8 11:38

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


I found a very old and bad bug in "tplfile" table.

if module template type was not "module" (if its type was admin) it will created countless duplicate templates with each update.

you can easily find this bug by updating system module several times then go to phpmyadmin and table "tplfile" and search for tpl_module = system
SELECT FROM PREFIX_tplfile WHERE tpl_module "system"


You can find duplicate rows.

to solve that i change 2 files + version in xoops_version.php
1- xoops256/modules/system/admin/modulesadmin/main.php
2- xoops256/modules/system/include/update.php
3- xoops256/modules/system/xoops_version.php

in xoops_version.php i just change the version from 2.10 to 2.11 to warn user to update system module.

I create a patch for this bug.
www.jadoogaran.org/d/XOOPS256_patch_duplicate_template.zip

also i update persian trunk:
http://svn.code.sf.net/p/xoops/svn//XoopsLanguages/persian/core/trunk/

to implement:
1- upload and overwrite files.
2- go to admin > modules > system > modules > update "system module"
3- clear all caches in admin > modules > system > maintenance

Please test this patch first and then use it with your own risk in running websites.

2
irmtfan
Re: xoops256 bug (very important): template duplicate issue
  • 2013/5/11 4:33

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


I implement this bug fix in some small websites and the result is amazing. Now i dont need to use Altsys.
I think this bug is solved:
http://sourceforge.net/p/xoops/bugs/1221/
so please somebody refer to this bug comments.
If you see below very old core file, you can find a previous core developer tried to solve this bug a long time ago:
http://svn.code.sf.net/p/xoops/svn/XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/include/update.php
but he failed.
I used his code (I could use better codes too) to show you it can be solved.

3
irmtfan
Re: xoops256 bug (very important): template duplicate issue
  • 2013/5/28 5:03

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Please somebody add this bug to sf.net tracker and if possible include the patch.
thank you.

4
Mamba
Re: xoops256 bug (very important): template duplicate issue
  • 2013/5/28 5:25

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


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

5
Mamba
Re: xoops256 bug (very important): template duplicate issue
  • 2013/9/15 1:34

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


This is been now tested and committed to SVN for "new" installations.

TODO: provide Upgrade for existing installation, which will require to remove duplicate records, or empty the table and then update all installed modules.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

6
irmtfan
Re: xoops256 bug (very important): template duplicate issue
  • 2013/9/15 13:30

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:

TODO: provide Upgrade for existing installation, which will require to remove duplicate records, or empty the table and then update all installed modules.


It is already done. user need to update system module after upgrade to newer xoops version and duplicate templates will be removed from table.

7
Mamba
Re: xoops256 bug (very important): template duplicate issue
  • 2013/9/15 13:42

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


I wish, it would be so easy!

You need to change the structure of the database, but since you have duplicate records, you can not add a "unique index key" to the database. So we need to either remove the duplicate records, or empty the table and then update the modules.

OK, unless I am missing something here

I admit, I have tried to add the unique key manually via phpMyAdmin, so I didn't try to just update the module.

So are you saying that I should try that, and it will work?

That would be cool
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

8
irmtfan
Re: xoops256 bug (very important): template duplicate issue
  • 2013/9/28 1:54

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


This fix is for upgrade previous xoops versions.
For a fresh install adding a unique key is enough.

9
irmtfan
Re: xoops256 bug (very important): template duplicate issue
  • 2013/10/4 4:40

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Are we ready to implement this solution?
As I described earlier this solution is not the most efficient way for deleting duplicate templates. (It deleted duplicate templates one by one but they can be deleted at once)
We can improve it if you or core team prefer before implement to 2.5.7
But anyway IMO efficiency is not too important in update processes because update will be done only one time.
In update process accuracy and logs are important.

Login

Who's Online

255 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 255


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits