1
Oraklet
Problems with cloning of modules - redeclaration of function. in two different modules.
  • 2008/10/21 10:16

  • Oraklet

  • Just popping in

  • Posts: 7

  • Since: 2008/7/24


Hi!

I'm trying to do something presumable simple, but keeps running wild!

Please help me, I'm getting more and more frustrated!

I have this module Pages, works fine, no problem! I have modified it to a degree that it is almost automated under install, I'm customising the module so that I can call the module directory anything, ( using the $xoopsModule->dirname() everywhere there is a reference) That actually works with no problems at all! The only thing I have to do manually to this point is, in the .sql file to rename the table headers and names acordingly to the folder name, then it runs smoothly.

That works when ever I do install the module, under any given name. no errors!

If I copy that module folder (Pages to e.g. NewPages) and do the renaming in the .sql files.
In the install module part, I can install the new module, It goes to complete, and when I return to the main page it is blank.

I can then get any of them to work, by renaming the other folder to something lige (pages_) then the NewPages works, do I then change it back, same blank page, renaming NewPages to Newpages_ then Pages works fine.

I'm that far that I get an error message that a function can't be redeclared! Normally when I did programs earlyer on, I havent encountered this problem, the functions lies in the include directory in each individual folder, no calls to the others.

Why do I get this problem, It doesn't helps to rename the function in one of the modules together with where it is called from. så that i calls the right function.

Please help me, I have a deadline 31. of october!
Mail me for a zipped version of the modules, at cholm@stageone.dk, if You want to help, and want to see what errors there are.

Kind regards

Carsten Holm
Odense, Denmark

2
kerkyra
Re: Problems with cloning of modules - redeclaration of function. in two different modules.
  • 2008/10/21 10:46

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hey mate are you using include or include_once? try the second one on both modules and see what happens..
whttp://www.guidemap.gr - Beta is out...

3
trabis
Re: Problems with cloning of modules - redeclaration of function. in two different modules.
  • 2008/10/21 12:58

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:
Why do I get this problem, It doesn't helps to rename the function in one of the modules together with where it is called from. så that i calls the right function.


You really need to change your functions name, especially if:
You want to use blocks of both clones in the same page
You have a module that is using functions from both modules
xoops_version.php is using any function inside it.

If you want you can email me the original module and I will try to make it clonable.

4
Oraklet
Re: Problems with cloning of modules - redeclaration of function. in two different modules.
  • 2008/10/21 13:05

  • Oraklet

  • Just popping in

  • Posts: 7

  • Since: 2008/7/24


Hi!

I'm using the include_once only in this case where the file is included.
And that's in every file in the module where it has to be included.

But thanks for the hint anyway.
I just seems to be stuck! :( You know tinkering with the code for a prolonged period... and still it seems like there is no way out!)


Kind regards.
Carsten

5
Oraklet
Re: Problems with cloning of modules - redeclaration of function. in two different modules.
  • 2008/10/21 13:30

  • Oraklet

  • Just popping in

  • Posts: 7

  • Since: 2008/7/24


To Trabis!

Quote:
If you want you can email me the original module and I will try to make it clonable.


Please send me an e-mail adress so that I can return the module to You.

Send an empty mail to cholm@stageone.dk


Kind regards
Carsten

Login

Who's Online

155 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 155


more...

Donat-O-Meter

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

Latest GitHub Commits