1
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'.

Login

Who's Online

345 user(s) are online (229 user(s) are browsing Support Forums)


Members: 0


Guests: 345


more...

Donat-O-Meter

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

Latest GitHub Commits