1
Feugy
Re: Module installation bug
  • 2004/3/14 9:36

  • Feugy

  • Just popping in

  • Posts: 3

  • Since: 2004/1/4 1


Thank you all. I just checked the 2.0.6 version, and they're in. I'll go to the SourceForge site, and report them.


...And promiss, I'll continue to make mistakes in english



2
Feugy
Module installation bug
  • 2004/3/13 23:34

  • Feugy

  • Just popping in

  • Posts: 3

  • Since: 2004/1/4 1


Hello !
An easy bug of the 2.0.5.1 version. I don't have download the 2.0.6 version, so perhaps it has already been fixed.

En using a post-installation script ($modversion['onInstall']), the installation log is excpected to display a message about the success (or not) of yhis script. In fact, it doesn't display anything, because the message are stored in the wrong array. Let's see the bugged code :
/modules/system/modulesadmin/modulesadmin.php lines 466 to 478
// execute module specific install script if any
$install_script = $module->getInfo('onInstall');
if (false != $install_script && trim($install_script) != '') {
include_once XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.trim($install_script);
if (function_exists('xoops_module_install_'.$dirname)){
$func = 'xoops_module_install_'.$dirname;
if (!$func($module)) {
$msg[] = 'Failed to execute '.$func;
} else {
$msg[] = '<b>'.$func.'</b> executed successfully.';
}
}
}


I guess you've understand... Just add an "s" to the $msgs array, and it's over.

One last thing, I posted a bug report for the XoopsObject class on the 2004/1/4, (https://xoops.org/modules/newbb/viewtopic.php?topic_id=15332&forum=21) and never get any answers... I've said something wrong ?



3
Feugy
Class XoopsObject minor bug.
  • 2004/1/4 17:49

  • Feugy

  • Just popping in

  • Posts: 3

  • Since: 2004/1/4 1


Hello eveyone, I just want to warn you, I'm a 'fromage qui pue' and so my english isn't garantee from Oxford...

As I'm developping a personnal module, I extends the XoopsObject class, in order to map my own database table.
I'm very curious, so I looked into the code, to understand the main methods.
The (minor) bug I found concern the cleanVars() method.
When a new variable (array vars) doesn't fit with its requirements, we just expect the method to tell us, and to keep the corresponding clean variable (array cleanVars) in it's old state (if their is one).
But actually, the clean variable is changed even if an error is found in the corresponding variable.

This is due to a Php trap : the continue ; keyword.
Continue just drops you to the END (after the last instruction, before the closing bracket) of ANY loop : a for, a while... and a switch. So when you got a switch loop enclosed in a for loop, you can return to the end of the switch by using
continue ; and return to the end of the for by using continue 2; (which means you want to jump to the second loop).

So, if the developper's intention was to jump to se for loop, and avoids to change the cleanVars value, we must change all continue ; by continue 2; In the switch loop.

This isn't really important, but in my case, I want to display in a form the new values wich are correct, and old ones when the user enter wrong values.

I just hope you understand me, and really need to congratulate the developpement team, which made a incredible work (but without any consequent documentation unfortunatly ).

See you 'et comme on dit chez nous, a p'luche'.




TopTop



Login

Who's Online

164 user(s) are online (77 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

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

Latest GitHub Commits