|
From: Alex B. <en...@tu...> - 2001-07-09 20:08:16
|
> I have a module Warning.php that collects non-fatal warnings for
> the application and prints them out in a "pane" of the page render.
> I have another module that does a lot of database work in the
> constructor, and that is where this stack of warnings is most
> exercised. I have scattered some printf's for debugging.
Ok.
> Basically, in this stack in a module that has already been instantiated
> and is collecting warnings from a constructor "behind" it, looses its
> stack when Output() is called by BC for the module.
>
> viz (the Before/After bracket the new in Page.php):
> Before instantiation of lib.EyeLibrary
> After instantiation of lib.EyeLibrary
> Before instantiation of astronomy.LookupTable
> After instantiation of astronomy.LookupTable
> Before instantiation of lib.Warning
> After instantiation of lib.Warning
> Before instantiation of astronomy.Top
> After instantiation of astronomy.Top
> Before instantiation of astronomy.Nav
> After instantiation of astronomy.Nav
> Before instantiation of lib.EditTable
> In EditTable constructor
> setWarning called...with [You have asked for a record that is greater
> than the number in the data set. Record set to last record.]. Now 1
> warnings on stack.
> setWarning called...with [Right after existence]. Now 2 warnings on
> stack.
> setWarning called...with [Right after existence]. Now 3 warnings on
> stack.
> After instantiation of lib.EditTable
> === Above gets printed before page render
>
> And, in the page render (Output) I get:
> setWarning called...with [Test inside
> /usr/local/binarycloud/build/en/user/mod/lib/Warning.php]. Now 1
> warnings on stack.
>
> only one on the stack, and that was a "phoney" call to the
> Warning->setWarning()
> in Warning->Output(). I lost all the warnings made in the consstructor
> of EditTable.
>
> This is the method in the lib.Warning module:
> ------------------------------------------------
> function setWarning($msg="Unknown warning") {
> $this->HaveWarning = true;
> array_push($this->Warnings,$msg);
> printf("setWarning called...with [%s]. Now %d warnings on
> stack.<br>\n",
> $msg,count($this->Warnings));
> }
> --------------------------
>
> NOW NOBODY SHOULD WASTE ANY TIME ON THIS unless someone has had a
> similar
> problem and it is, somehow, related to the BC environment.
I don't see any problems with your code, but I can also tell you with near
absolute certainty that it isn't Page or anything in BC doing it :)
_a
--
alex black, ceo
en...@tu...
the turing studio, inc.
http://www.turingstudio.com
vox+510.666.0074
fax+510.666.0093
|