|
From: Jakub A. <jak...@se...> - 2003-03-06 21:33:24
|
Mitra, ad 3: I can not find the bug with StoreItem. Could you help me? Everything is working fine for me. I have commented the rows in again. Please could you try to comment out individual functions in event_handler.php3 (like AuthUpdateReaders etc.) so that I know which function caused troubles? Or could you give me some access to some pages? ad 4: This was a new bug. Thanks for finding it. Fixed. ad 5: I have created an example in doc/script/show_result.php3 ad 6: I will try to make the FAQ consistent with doc/anonym ad 8: I am not sure what was your problem. The wizard creates the code for a .shtml page. Of course the code is created by a PHP script. I changed a bit the documentation in doc/anonym to clarify this point. I hope doc/script/show_result.php3 will help you with the results page. I don't know why you need to create an anonymous form otherwise than with a .shtml page. I think the SSI includes do most resemble the readfile() PHP function. You only need to pass the post2sthml_id parameter to the PHP scripts called by readfile(). Jakub -----Original Message----- From: apc...@li... [mailto:apc...@li...] On Behalf Of Mitra Sent: Thursday, March 06, 2003 1:17 PM To: hon...@ec...; apc...@so... Subject: [Apc-aa-coders] Forms and error handling Hi Honza thanks for the Yahoo chat, at least I think we are getting closer to solving some of this mess. As I see it, we have at least 6 sets of bugs to deal with So there are at least x bugs 1: The insert_fnc_fil etc functions don't always set $err[xxx] but either return a value, or set $err (string) etc 2: Some validate functions return an error, even if there is not one - for example if you try and post an anonymous form NOT containing a publish date, to a slice where Publish_date is marked as required&show then it will generate an error, rather than using the default 3: StoreItem crashes when it calls the event code when running off an anonymous form I've commented that call out in the CVS version until someone (Jakub?) fixes the bug. 4: filler.php3 ALWAYS calls the err_url because $err is ALWAYS an array even if it contains just "success". This was probably never spotted since the wizard uses the same URL for both. I'm going to assume that the array is correct, and the code is wrong, since anonym.html mentions "success". 5: Insufficient documentation on how to create an error page that will display the error. See http://aa.ecn.cz/apc-aa-dev/doc/anonym.html. for some docs, but even after reading these I'm having difficulty figuring out how to build a simple page (to go in err_url) that displays the error from the $err array and prompts the user to fix the problem - its even harder since what I really want is to set err_url to "mysite.shtml?i=99" since this is all driven by the "site" module, so I have to understand what is happening in order to modify it to do what I need. 6: The Documentation there is i.e. anonym.html isn't linked into either doc/index.html or the FAQ, so in effect it doesn't exist! PLEASE PLEASE LINK ALL DOCUMENTATION SO SOMEONE CAN FIND IT AGAIN 7: The FAQ is inconsistent with anonym.html, i.e. http://apc-aa.sourceforge.net/faq/#anonymous still says to cut and paste from "Add Item" instead of using the wizard. 8: anonym.html says "This wizard creates a complete form with the SSI include of fillform.php3 necessary to edit items. The resulting form differs depending on whether Anonymous editing is allowed or not." That is not what it appears to do - it outputs a PHP form, with no SSI. This might sound trivial, but we lost at least a day or more of work trying to figure it out (without seeing anonym.htm) and then looking for why it didn't work properly. I'm going to start fixing some of these bugs tomorrow, so please say something if I'm missing something - especially with items 1,2 or 4 I'd appreciate some help with figuring out how to do the results page, ideally within a "site" i.e. from within PHP3, with no access to SHTML. I've introduced the concept of a current item in the site, (you can see this in site_bayfm.php3) using this might be the best mechanism to get at the posted data, but I'm not sure about that? - Mitra -- Mitra Technology Consulting - www.mitra.biz - mi...@mi... 02-6684-8096 or 0414-648-0722 Life is a Mystery to be Lived, not a Problem to be Solved |
|
From: Mitra <mi...@ea...> - 2003-03-06 22:55:39
|
At 10:32 PM +0100 6/3/03, Jakub Adamek wrote:
>Mitra,
>
>ad 3: I can not find the bug with StoreItem. Could you help me?
>Everything is working fine for me. I have commented the rows in
>again. Please could you try to comment out individual functions in
>event_handler.php3 (like AuthUpdateReaders etc.) so that I know
>which function caused troubles? Or could you give me some access to
>some pages?
Ok - I will look into this deeper, I think I still have a form that
will generate the problem if I uncomment those lines.
>ad 4: This was a new bug. Thanks for finding it. Fixed.
>ad 5: I have created an example in doc/script/show_result.php3
Thanks - that script is useful,
>ad 6: I will try to make the FAQ consistent with doc/anonym
>ad 8: I am not sure what was your problem. The wizard creates the
>code for a .shtml page. Of course the code is created by a PHP
>script. I changed a bit the documentation in doc/anonym to clarify
>this point.
Where is this SHTML page created? When I run the wizard I get a PHP3 page,
I choose the slice, SliceAdmin / Anon Form Wiz ; change the URL;
Click Show Form and I get a screen anonym_wizard.php3 with NO SHTML
that I can find. This is the code for the PHP3 page, not for the
SHTML page?
>
>I hope doc/script/show_result.php3 will help you with the results
>page. I don't know why you need to create an anonymous form
>otherwise than with a .shtml page.
Because the anonymous form is on "site" i.e. created with
modules/site, the only .shtml is a page containing<!--#include
site.php3?....-->, so I take the PHP generated and put it into the
site module, the URL on success is just '?i=10' meaning to go to item
10, which would be the thankyou page, and then "i=11" for failure,
but I can't figure out what to put into the failure page.
I can't put a SHTML include there, or PHP, all I can really put there
is something inside {....} and have stringexpand.php3 expand it. I
COULD put an {include} here if I could figure out what to put inside
it, but it would make much more sense to do it directly with a {...}
IF I COULD FIGURE OUT HOW THE RESULT IS STORED.
>I think the SSI includes do most resemble the readfile() PHP
>function. You only need to pass the post2sthml_id parameter to the
>PHP scripts called by readfile().
Sorry, I don't understand what you mean here at all, could you give
an example. How do I get this post2shtml_id parameter? I'm assuming
it is generated by filler.php3 somehow? Is it appended to the err_url?
Can I make a suggestion .....
When really complex stuff like this isbuilt, could you generate some
ARCHITECTURE documentation, as well as the docs like anonym.html AND
an example. Things that are obvious to the coder, just aren't
obvious to someone else looking at it. For example in this case .....
we need to know. ...(this is just an example, I KNOW that I don't
have it right, because I don't understand how this is working)
1: insert_fnc_xxx generate errors like
$GLOBALS[err][headline........] = "This string is too long"
2: filler.php3 martials these and stores them in its own
$err[validate] (NOTE THIS IS REUSE OF THE GLOBAL, THIS NEW
$err HAS A DIFFERENT STRUCTURE FROM THE $err filled by insert_fnc_xxxx
3: The result is stored somewhere ...
4: The id parameter is passed back ... how?
4: fillform.php3 gets this parameter from the URL which is the id
field of the xxxx table
and so on .....
This documentation can be quite brief, but its crucial to being able
to debug. Without something like this, its impossible to trace a bug
back and know which step is doing it wrong, and there is a real
danger that one coder will go in and "FIX" something which isn't a
bug, and therefore break something else.
- Mitra
>-----Original Message-----
>From: apc...@li...
>[mailto:apc...@li...] On Behalf Of Mitra
>Sent: Thursday, March 06, 2003 1:17 PM
>To: hon...@ec...; apc...@so...
>Subject: [Apc-aa-coders] Forms and error handling
>
>Hi Honza
>
>thanks for the Yahoo chat, at least I think we are getting closer to
>solving some of this mess.
>
>As I see it, we have at least 6 sets of bugs to deal with
>
>So there are at least x bugs
>
>1: The insert_fnc_fil etc functions don't always set $err[xxx] but
>either return a value, or set $err (string) etc
>
>2: Some validate functions return an error, even if there is not one
>- for example if you try and post an anonymous form NOT containing a
>publish date, to a slice where Publish_date is marked as
>required&show then it will generate an error, rather than using the
>default
>
>3: StoreItem crashes when it calls the event code when running off
>an anonymous form I've commented that call out in the CVS version
>until someone (Jakub?) fixes the bug.
>
>4: filler.php3 ALWAYS calls the err_url because $err is ALWAYS an
>array even if it contains just "success". This was probably never
>spotted since the wizard uses the same URL for both. I'm going to
>assume that the array is correct, and the code is wrong, since
>anonym.html mentions "success".
>
>5: Insufficient documentation on how to create an error page that
>will display the error. See
>http://aa.ecn.cz/apc-aa-dev/doc/anonym.html. for some docs, but even
>after reading these I'm having difficulty figuring out how to build
>a simple page (to go in err_url) that displays the error from the
>$err array and prompts the user to fix the problem - its even
>harder since what I really want is to set err_url to
>"mysite.shtml?i=99" since this is all driven by the "site" module,
>so I have to understand what is happening in order to modify it to
>do what I need.
>
>6: The Documentation there is i.e. anonym.html isn't linked into
>either doc/index.html or the FAQ, so in effect it doesn't exist!
>PLEASE PLEASE LINK ALL DOCUMENTATION SO SOMEONE CAN FIND IT AGAIN
>
>7: The FAQ is inconsistent with anonym.html, i.e.
>http://apc-aa.sourceforge.net/faq/#anonymous still says to cut and
>paste from "Add Item" instead of using the wizard.
>
>8: anonym.html says "This wizard creates a complete form with the
>SSI include of fillform.php3 necessary to edit items. The resulting
>form differs depending on whether Anonymous editing is allowed or
>not." That is not what it appears to do - it outputs a PHP form,
>with no SSI.
>
>This might sound trivial, but we lost at least a day or more of work
>trying to figure it out (without seeing anonym.htm) and then looking
>for why it didn't work properly.
>
>I'm going to start fixing some of these bugs tomorrow, so please say
>something if I'm missing something - especially with items 1,2 or 4
>
> I'd appreciate some help with figuring out how to do the results
>page, ideally within a "site" i.e. from within PHP3, with no access
>to SHTML. I've introduced the concept of a current item in the site,
>(you can see this in site_bayfm.php3) using this might be the best
>mechanism to get at the posted data, but I'm not sure about that?
>
>- Mitra
>
>--
>Mitra Technology Consulting - www.mitra.biz - mi...@mi...
>02-6684-8096 or 0414-648-0722
>
>Life is a Mystery to be Lived, not a Problem to be Solved
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
|
|
From: Mitra <mi...@ea...> - 2003-03-07 05:19:13
|
P.S. I've figured out where fillform.php3 goes, in an HTML version, though still have to figure out how to do this from within the site module, I wasn't seeing it there at the top of the HTML generated by the Form Wizard. The rest of the questions are still there .... I've updated CVS to latest version, but now there ARE TWO NEW BUGS, and I see one or the other, with no consistency I can find as to which happens. . You can see the anonymous form at http://byronbayfm.org.au/draft.shtml?i=21 and its setup so that there is no err_url defined so that I see the errors generated by an extra "print_r($txt) in SendErrorPage.php3 there is also a print_r of $GLOBALS to show exactly what the input in 1: About half the time, I t complains slice_id is not defined 2: The other half, It complains about redefinition of new_id, which is defined in util.php3:323 and post2shtml.php3:88 hitting reload on that page generates these two unpredictably, it always does one or the other .... - Mitra At 9:25 AM +1100 7/3/03, Mitra wrote: >At 10:32 PM +0100 6/3/03, Jakub Adamek wrote: >>Mitra, >> >>ad 3: I can not find the bug with StoreItem. Could you help me? >>Everything is working fine for me. I have commented the rows in >>again. Please could you try to comment out individual functions in >>event_handler.php3 (like AuthUpdateReaders etc.) so that I know >>which function caused troubles? Or could you give me some access to >>some pages? > >Ok - I will look into this deeper, I think I still have a form that >will generate the problem if I uncomment those lines. > >>ad 4: This was a new bug. Thanks for finding it. Fixed. >>ad 5: I have created an example in doc/script/show_result.php3 > >Thanks - that script is useful, > >>ad 6: I will try to make the FAQ consistent with doc/anonym >>ad 8: I am not sure what was your problem. The wizard creates the >>code for a .shtml page. Of course the code is created by a PHP >>script. I changed a bit the documentation in doc/anonym to clarify >>this point. > >Where is this SHTML page created? When I run the wizard I get a PHP3 page, > >I choose the slice, SliceAdmin / Anon Form Wiz ; change the URL; >Click Show Form and I get a screen anonym_wizard.php3 with NO >SHTML that I can find. This is the code for the PHP3 page, not for >the SHTML page? > >> >>I hope doc/script/show_result.php3 will help you with the results >>page. I don't know why you need to create an anonymous form >>otherwise than with a .shtml page. > >Because the anonymous form is on "site" i.e. created with >modules/site, the only .shtml is a page containing<!--#include >site.php3?....-->, so I take the PHP generated and put it into the >site module, the URL on success is just '?i=10' meaning to go to >item 10, which would be the thankyou page, and then "i=11" for >failure, but I can't figure out what to put into the failure page. > >I can't put a SHTML include there, or PHP, all I can really put >there is something inside {....} and have stringexpand.php3 expand >it. I COULD put an {include} here if I could figure out what to put >inside it, but it would make much more sense to do it directly with >a {...} IF I COULD FIGURE OUT HOW THE RESULT IS STORED. > >>I think the SSI includes do most resemble the readfile() PHP >>function. You only need to pass the post2sthml_id parameter to the >>PHP scripts called by readfile(). > >Sorry, I don't understand what you mean here at all, could you give >an example. How do I get this post2shtml_id parameter? I'm >assuming it is generated by filler.php3 somehow? Is it appended to >the err_url? > >Can I make a suggestion ..... > >When really complex stuff like this isbuilt, could you generate some >ARCHITECTURE documentation, as well as the docs like anonym.html AND >an example. Things that are obvious to the coder, just aren't >obvious to someone else looking at it. For example in this case >..... we need to know. ...(this is just an example, I KNOW that I >don't have it right, because I don't understand how this is working) > >1: insert_fnc_xxx generate errors like >$GLOBALS[err][headline........] = "This string is too long" >2: filler.php3 martials these and stores them in its own >$err[validate] (NOTE THIS IS REUSE OF THE GLOBAL, THIS NEW >$err HAS A DIFFERENT STRUCTURE FROM THE $err filled by >insert_fnc_xxxx >3: The result is stored somewhere ... >4: The id parameter is passed back ... how? >4: fillform.php3 gets this parameter from the URL which is the id >field of the xxxx table > >and so on ..... > >This documentation can be quite brief, but its crucial to being able >to debug. Without something like this, its impossible to trace a bug >back and know which step is doing it wrong, and there is a real >danger that one coder will go in and "FIX" something which isn't a >bug, and therefore break something else. > >- Mitra > > > >>-----Original Message----- >>From: apc...@li... >>[mailto:apc...@li...] On Behalf Of >>Mitra >>Sent: Thursday, March 06, 2003 1:17 PM >>To: hon...@ec...; apc...@so... >>Subject: [Apc-aa-coders] Forms and error handling >> >>Hi Honza >> >>thanks for the Yahoo chat, at least I think we are getting closer >>to solving some of this mess. >> >>As I see it, we have at least 6 sets of bugs to deal with >> >>So there are at least x bugs >> >>1: The insert_fnc_fil etc functions don't always set $err[xxx] but >>either return a value, or set $err (string) etc >> >>2: Some validate functions return an error, even if there is not >>one - for example if you try and post an anonymous form NOT >>containing a publish date, to a slice where Publish_date is marked >>as required&show then it will generate an error, rather than using >>the default >> >>3: StoreItem crashes when it calls the event code when running off >>an anonymous form I've commented that call out in the CVS version >>until someone (Jakub?) fixes the bug. >> >>4: filler.php3 ALWAYS calls the err_url because $err is ALWAYS an >>array even if it contains just "success". This was probably never >>spotted since the wizard uses the same URL for both. I'm going to >>assume that the array is correct, and the code is wrong, since >>anonym.html mentions "success". >> >>5: Insufficient documentation on how to create an error page that >>will display the error. See >>http://aa.ecn.cz/apc-aa-dev/doc/anonym.html. for some docs, but >>even after reading these I'm having difficulty figuring out how to >>build a simple page (to go in err_url) that displays the error from >>the $err array and prompts the user to fix the problem - its even >>harder since what I really want is to set err_url to >>"mysite.shtml?i=99" since this is all driven by the "site" module, >>so I have to understand what is happening in order to modify it to >>do what I need. >> >>6: The Documentation there is i.e. anonym.html isn't linked into >>either doc/index.html or the FAQ, so in effect it doesn't exist! >>PLEASE PLEASE LINK ALL DOCUMENTATION SO SOMEONE CAN FIND IT AGAIN >> >>7: The FAQ is inconsistent with anonym.html, i.e. >>http://apc-aa.sourceforge.net/faq/#anonymous still says to cut and >>paste from "Add Item" instead of using the wizard. >> >>8: anonym.html says "This wizard creates a complete form with the >>SSI include of fillform.php3 necessary to edit items. The resulting >>form differs depending on whether Anonymous editing is allowed or >>not." That is not what it appears to do - it outputs a PHP form, >>with no SSI. >> >>This might sound trivial, but we lost at least a day or more of >>work trying to figure it out (without seeing anonym.htm) and then >>looking for why it didn't work properly. >> >>I'm going to start fixing some of these bugs tomorrow, so please >>say something if I'm missing something - especially with items 1,2 >>or 4 >> >> I'd appreciate some help with figuring out how to do the results >>page, ideally within a "site" i.e. from within PHP3, with no access >>to SHTML. I've introduced the concept of a current item in the >>site, (you can see this in site_bayfm.php3) using this might be the >>best mechanism to get at the posted data, but I'm not sure about >>that? >> >>- Mitra >> >>-- >>Mitra Technology Consulting - www.mitra.biz - mi...@mi... >>02-6684-8096 or 0414-648-0722 >> >>Life is a Mystery to be Lived, not a Problem to be Solved > > >-- >Mitra Technology Consulting - www.mitra.biz - mi...@mi... >02-6684-8096 or 0414-648-0722 > >Life is a Mystery to be Lived, not a Problem to be Solved -- Mitra Technology Consulting - www.mitra.biz - mi...@mi... 02-6684-8096 or 0414-648-0722 Life is a Mystery to be Lived, not a Problem to be Solved |
|
From: Jakub A. <jak...@se...> - 2003-03-07 18:15:52
|
Mitra,
the problem of defining new_id twice is fixed in CVS (if (!
function_exists ("new_id"))). Can you perhaps do an update? I get always
this error on refresh.
Jakub
-----Original Message-----
From: Mitra [mailto:mi...@ea...]
Sent: Friday, March 07, 2003 6:18 AM
To: Jakub Adamek; apc...@so...
Subject: RE: [Apc-aa-coders] Forms and error handling
P.S.
I've figured out where fillform.php3 goes, in an HTML version, though
still have to figure out how to do this from within the site module, I
wasn't seeing it there at the top of the HTML generated by the Form
Wizard.
The rest of the questions are still there ....
I've updated CVS to latest version, but now there ARE TWO NEW BUGS, and
I see one or the other, with no consistency I can find as to which
happens.
. You can see the anonymous form at
http://byronbayfm.org.au/draft.shtml?i=21 and its setup so that there
is no err_url defined so that I see the errors generated by an extra
"print_r($txt) in SendErrorPage.php3 there is also a print_r of
$GLOBALS to show exactly what the input in
1: About half the time, I t complains slice_id is not defined
2: The other half, It complains about redefinition of new_id, which is
defined in util.php3:323 and post2shtml.php3:88
hitting reload on that page generates these two unpredictably, it always
does one or the other ....
- Mitra
At 9:25 AM +1100 7/3/03, Mitra wrote:
At 10:32 PM +0100 6/3/03, Jakub Adamek wrote:
Mitra,
ad 3: I can not find the bug with StoreItem. Could you help me?
Everything is working fine for me. I have commented the rows in again.
Please could you try to comment out individual functions in
event_handler.php3 (like AuthUpdateReaders etc.) so that I know which
function caused troubles? Or could you give me some access to some
pages?
Ok - I will look into this deeper, I think I still have a form that will
generate the problem if I uncomment those lines.
ad 4: This was a new bug. Thanks for finding it. Fixed.
ad 5: I have created an example in doc/script/show_result.php3
Thanks - that script is useful,
ad 6: I will try to make the FAQ consistent with doc/anonym
ad 8: I am not sure what was your problem. The wizard creates the code
for a .shtml page. Of course the code is created by a PHP script. I
changed a bit the documentation in doc/anonym to clarify this point.
Where is this SHTML page created? When I run the wizard I get a PHP3
page,
I choose the slice, SliceAdmin / Anon Form Wiz ; change the URL; Click
Show Form and I get a screen anonym_wizard.php3 with NO SHTML that I
can find. This is the code for the PHP3 page, not for the SHTML page?
I hope doc/script/show_result.php3 will help you with the results page.
I don't know why you need to create an anonymous form otherwise than
with a .shtml page.
Because the anonymous form is on "site" i.e. created with modules/site,
the only .shtml is a page containing<!--#include site.php3?....-->, so I
take the PHP generated and put it into the site module, the URL on
success is just '?i=10' meaning to go to item 10, which would be the
thankyou page, and then "i=11" for failure, but I can't figure out what
to put into the failure page.
I can't put a SHTML include there, or PHP, all I can really put there is
something inside {....} and have stringexpand.php3 expand it. I COULD
put an {include} here if I could figure out what to put inside it, but
it would make much more sense to do it directly with a {...} IF I COULD
FIGURE OUT HOW THE RESULT IS STORED.
I think the SSI includes do most resemble the readfile() PHP function.
You only need to pass the post2sthml_id parameter to the PHP scripts
called by readfile().
Sorry, I don't understand what you mean here at all, could you give an
example. How do I get this post2shtml_id parameter? I'm assuming it is
generated by filler.php3 somehow? Is it appended to the err_url?
Can I make a suggestion .....
When really complex stuff like this isbuilt, could you generate some
ARCHITECTURE documentation, as well as the docs like anonym.html AND an
example. Things that are obvious to the coder, just aren't obvious to
someone else looking at it. For example in this case ..... we need to
know. ...(this is just an example, I KNOW that I don't have it right,
because I don't understand how this is working)
1: insert_fnc_xxx generate errors like $GLOBALS[err][headline........] =
"This string is too long"
2: filler.php3 martials these and stores them in its own $err[validate]
(NOTE THIS IS REUSE OF THE GLOBAL, THIS NEW $err HAS A DIFFERENT
STRUCTURE FROM THE $err filled by insert_fnc_xxxx
3: The result is stored somewhere ...
4: The id parameter is passed back ... how?
4: fillform.php3 gets this parameter from the URL which is the id field
of the xxxx table
and so on .....
This documentation can be quite brief, but its crucial to being able to
debug. Without something like this, its impossible to trace a bug back
and know which step is doing it wrong, and there is a real danger that
one coder will go in and "FIX" something which isn't a bug, and
therefore break something else.
- Mitra
-----Original Message-----
From: apc...@li...
[mailto:apc...@li...] On Behalf Of Mitra
Sent: Thursday, March 06, 2003 1:17 PM
To: hon...@ec...; apc...@so...
Subject: [Apc-aa-coders] Forms and error handling
Hi Honza
thanks for the Yahoo chat, at least I think we are getting closer to
solving some of this mess.
As I see it, we have at least 6 sets of bugs to deal with
So there are at least x bugs
1: The insert_fnc_fil etc functions don't always set $err[xxx] but
either return a value, or set $err (string) etc
2: Some validate functions return an error, even if there is not one -
for example if you try and post an anonymous form NOT containing a
publish date, to a slice where Publish_date is marked as required&show
then it will generate an error, rather than using the default
3: StoreItem crashes when it calls the event code when running off an
anonymous form I've commented that call out in the CVS version until
someone (Jakub?) fixes the bug.
4: filler.php3 ALWAYS calls the err_url because $err is ALWAYS an array
even if it contains just "success". This was probably never spotted
since the wizard uses the same URL for both. I'm going to assume that
the array is correct, and the code is wrong, since anonym.html mentions
"success".
5: Insufficient documentation on how to create an error page that will
display the error. See http://aa.ecn.cz/apc-aa-dev/doc/anonym.html. for
some docs, but even after reading these I'm having difficulty figuring
out how to build a simple page (to go in err_url) that displays the
error from the $err array and prompts the user to fix the problem - its
even harder since what I really want is to set err_url to
"mysite.shtml?i=99" since this is all driven by the "site" module, so I
have to understand what is happening in order to modify it to do what I
need.
6: The Documentation there is i.e. anonym.html isn't linked into either
doc/index.html or the FAQ, so in effect it doesn't exist! PLEASE
PLEASE LINK ALL DOCUMENTATION SO SOMEONE CAN FIND IT AGAIN
7: The FAQ is inconsistent with anonym.html, i.e.
http://apc-aa.sourceforge.net/faq/#anonymous still says to cut and paste
from "Add Item" instead of using the wizard.
8: anonym.html says "This wizard creates a complete form with the SSI
include of fillform.php3 necessary to edit items. The resulting form
differs depending on whether Anonymous editing is allowed or not." That
is not what it appears to do - it outputs a PHP form, with no SSI.
This might sound trivial, but we lost at least a day or more of work
trying to figure it out (without seeing anonym.htm) and then looking for
why it didn't work properly.
I'm going to start fixing some of these bugs tomorrow, so please say
something if I'm missing something - especially with items 1,2 or 4
I'd appreciate some help with figuring out how to do the results page,
ideally within a "site" i.e. from within PHP3, with no access to SHTML.
I've introduced the concept of a current item in the site, (you can see
this in site_bayfm.php3) using this might be the best mechanism to get
at the posted data, but I'm not sure about that?
- Mitra
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
|
|
From: Mitra <mi...@ea...> - 2003-03-07 21:38:37
|
OK - I've updated and no errors are being generated now, although the
item is not being added. I'll take more looks - won't be today -
and see if I can track down the bug in StoreItem
Can you give a short write up on the architecture, as suggested below?
See separate message about redefining functions :-)
- Mitra
At 7:15 PM +0100 7/3/03, Jakub Adamek wrote:
>Mitra,
>
>the problem of defining new_id twice is fixed in CVS (if (!
>function_exists ("new_id"))). Can you perhaps do an update? I get
>always this error on refresh.
>
>Jakub
>
>-----Original Message-----
>From: Mitra [mailto:mi...@ea...]
>Sent: Friday, March 07, 2003 6:18 AM
>To: Jakub Adamek; apc...@so...
>Subject: RE: [Apc-aa-coders] Forms and error handling
>
>P.S.
>
>I've figured out where fillform.php3 goes, in an HTML version,
>though still have to figure out how to do this from within the site
>module, I wasn't seeing it there at the top of the HTML generated by
>the Form Wizard.
>
>The rest of the questions are still there ....
>
>I've updated CVS to latest version, but now there ARE TWO NEW BUGS,
>and I see one or the other, with no consistency I can find as to
>which happens.
>
>. You can see the anonymous form at
>http://byronbayfm.org.au/draft.shtml?i=21 and its setup so that
>there is no err_url defined so that I see the errors generated by an
>extra "print_r($txt) in SendErrorPage.php3 there is also a print_r
>of $GLOBALS to show exactly what the input in
>
>1: About half the time, I t complains slice_id is not defined
>
>2: The other half, It complains about redefinition of new_id, which
>is defined in util.php3:323 and post2shtml.php3:88
>
>hitting reload on that page generates these two unpredictably, it
>always does one or the other ....
>
>- Mitra
>
>At 9:25 AM +1100 7/3/03, Mitra wrote:
>
>>At 10:32 PM +0100 6/3/03, Jakub Adamek wrote:
>>
>>>Mitra,
>>>
>>
>>
>>ad 3: I can not find the bug with StoreItem. Could you help me?
>>Everything is working fine for me. I have commented the rows in
>>again. Please could you try to comment out individual functions in
>>event_handler.php3 (like AuthUpdateReaders etc.) so that I know
>>which function caused troubles? Or could you give me some access to
>>some pages?
>>
>
>Ok - I will look into this deeper, I think I still have a form that
>will generate the problem if I uncomment those lines.
>
>
>>ad 4: This was a new bug. Thanks for finding it. Fixed.
>>
>ad 5: I have created an example in doc/script/show_result.php3
>
>
>Thanks - that script is useful,
>
>
>>ad 6: I will try to make the FAQ consistent with doc/anonym
>>
>ad 8: I am not sure what was your problem. The wizard creates the
>code for a .shtml page. Of course the code is created by a PHP
>script. I changed a bit the documentation in doc/anonym to clarify
>this point.
>
>
>Where is this SHTML page created? When I run the wizard I get a PHP3 page,
>
>
>I choose the slice, SliceAdmin / Anon Form Wiz ; change the URL;
>Click Show Form and I get a screen anonym_wizard.php3 with NO
>SHTML that I can find. This is the code for the PHP3 page, not for
>the SHTML page?
>
>
>>
>
>I hope doc/script/show_result.php3 will help you with the results
>page. I don't know why you need to create an anonymous form
>otherwise than with a .shtml page.
>
>
>Because the anonymous form is on "site" i.e. created with
>modules/site, the only .shtml is a page containing<!--#include
>site.php3?....-->, so I take the PHP generated and put it into the
>site module, the URL on success is just '?i=10' meaning to go to
>item 10, which would be the thankyou page, and then "i=11" for
>failure, but I can't figure out what to put into the failure page.
>
>
>I can't put a SHTML include there, or PHP, all I can really put
>there is something inside {....} and have stringexpand.php3 expand
>it. I COULD put an {include} here if I could figure out what to put
>inside it, but it would make much more sense to do it directly with
>a {...} IF I COULD FIGURE OUT HOW THE RESULT IS STORED.
>
>
>>I think the SSI includes do most resemble the readfile() PHP
>>function. You only need to pass the post2sthml_id parameter to the
>>PHP scripts called by readfile().
>>
>
>Sorry, I don't understand what you mean here at all, could you give
>an example. How do I get this post2shtml_id parameter? I'm
>assuming it is generated by filler.php3 somehow? Is it appended to
>the err_url?
>
>
>Can I make a suggestion .....
>
>
>When really complex stuff like this isbuilt, could you generate some
>ARCHITECTURE documentation, as well as the docs like anonym.html AND
>an example. Things that are obvious to the coder, just aren't
>obvious to someone else looking at it. For example in this case
>..... we need to know. ...(this is just an example, I KNOW that I
>don't have it right, because I don't understand how this is working)
>
>
>1: insert_fnc_xxx generate errors like
>$GLOBALS[err][headline........] = "This string is too long"
>
>2: filler.php3 martials these and stores them in its own
>$err[validate] (NOTE THIS IS REUSE OF THE GLOBAL, THIS NEW
>$err HAS A DIFFERENT STRUCTURE FROM THE $err filled by
>insert_fnc_xxxx
>
>3: The result is stored somewhere ...
>
>4: The id parameter is passed back ... how?
>
>4: fillform.php3 gets this parameter from the URL which is the id
>field of the xxxx table
>
>
>and so on .....
>
>
>This documentation can be quite brief, but its crucial to being able
>to debug. Without something like this, its impossible to trace a bug
>back and know which step is doing it wrong, and there is a real
>danger that one coder will go in and "FIX" something which isn't a
>bug, and therefore break something else.
>
>
>- Mitra
>
>
>
>
>>-----Original Message-----
>>From: apc...@li...
>>[mailto:apc...@li...] On Behalf Of
>>Mitra
>>Sent: Thursday, March 06, 2003 1:17 PM
>>To: hon...@ec...; apc...@so...
>>Subject: [Apc-aa-coders] Forms and error handling
>>
>>Hi Honza
>>
>>
>>thanks for the Yahoo chat, at least I think we are getting closer
>>to solving some of this mess.
>>
>>
>>As I see it, we have at least 6 sets of bugs to deal with
>>
>>
>>So there are at least x bugs
>>
>>1: The insert_fnc_fil etc functions don't always set $err[xxx] but
>>either return a value, or set $err (string) etc
>>
>>
>>2: Some validate functions return an error, even if there is not
>>one - for example if you try and post an anonymous form NOT
>>containing a publish date, to a slice where Publish_date is marked
>>as required&show then it will generate an error, rather than using
>>the default
>>
>>
>>3: StoreItem crashes when it calls the event code when running off
>>an anonymous form I've commented that call out in the CVS version
>>until someone (Jakub?) fixes the bug.
>>
>>
>>4: filler.php3 ALWAYS calls the err_url because $err is ALWAYS an
>>array even if it contains just "success". This was probably never
>>spotted since the wizard uses the same URL for both. I'm going to
>>assume that the array is correct, and the code is wrong, since
>>anonym.html mentions "success".
>>
>>
>>5: Insufficient documentation on how to create an error page that
>>will display the error. See
>>http://aa.ecn.cz/apc-aa-dev/doc/anonym.html. for some docs, but
>>even after reading these I'm having difficulty figuring out how to
>>build a simple page (to go in err_url) that displays the error from
>>the $err array and prompts the user to fix the problem - its even
>>harder since what I really want is to set err_url to
>>"mysite.shtml?i=99" since this is all driven by the "site" module,
>>so I have to understand what is happening in order to modify it to
>>do what I need.
>>
>>
>>6: The Documentation there is i.e. anonym.html isn't linked into
>>either doc/index.html or the FAQ, so in effect it doesn't exist!
>>PLEASE PLEASE LINK ALL DOCUMENTATION SO SOMEONE CAN FIND IT AGAIN
>>
>>
>>7: The FAQ is inconsistent with anonym.html, i.e.
>>http://apc-aa.sourceforge.net/faq/#anonymous still says to cut and
>>paste from "Add Item" instead of using the wizard.
>>
>>
>>8: anonym.html says "This wizard creates a complete form with the
>>SSI include of fillform.php3 necessary to edit items. The resulting
>>form differs depending on whether Anonymous editing is allowed or
>>not." That is not what it appears to do - it outputs a PHP form,
>>with no SSI.
>>
>>
>>This might sound trivial, but we lost at least a day or more of
>>work trying to figure it out (without seeing anonym.htm) and then
>>looking for why it didn't work properly.
>>
>>
>>I'm going to start fixing some of these bugs tomorrow, so please
>>say something if I'm missing something - especially with items 1,2
>>or 4
>>
>>
>> I'd appreciate some help with figuring out how to do the results
>>page, ideally within a "site" i.e. from within PHP3, with no access
>>to SHTML. I've introduced the concept of a current item in the
>>site, (you can see this in site_bayfm.php3) using this might be the
>>best mechanism to get at the posted data, but I'm not sure about
>>that?
>>
>>
>>- Mitra
>>
>>
>>--
>>
>>Mitra Technology Consulting - www.mitra.biz - mi...@mi...
>>
>>02-6684-8096 or 0414-648-0722
>>
>>
>>Life is a Mystery to be Lived, not a Problem to be Solved
>>
>
>
>--
>
>Mitra Technology Consulting - www.mitra.biz - mi...@mi...
>02-6684-8096 or 0414-648-0722
>
>Life is a Mystery to be Lived, not a Problem to be Solved
>
>
>
>--
>Mitra Technology Consulting - www.mitra.biz - mi...@mi...
>02-6684-8096 or 0414-648-0722
>
>Life is a Mystery to be Lived, not a Problem to be Solved
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
|
|
From: Mitra <mi...@ea...> - 2003-03-11 22:33:56
|
Clearing up the points on these messages
>3: StoreItem crashes when it calls the event code when running off
>an anonymous form I've commented that call out in the CVS version
>until someone (Jakub?) fixes the bug.
>>>
>>>Jakub: ad 3: I can not find the bug with StoreItem. Could you help
>>>me? Everything is working fine for me. I have commented the rows
>>>in again. Please could you try to comment out individual functions
>>>in event_handler.php3 (like AuthUpdateReaders etc.) so that I know
>>>which function caused troubles? Or could you give me some access
>>>to some pages?
>
Mitra: I'll take more looks - won't be today - and see if I can track
down the bug in StoreItem
I'm not seeing any bugs in that Event code any more.
>>I hope doc/script/show_result.php3 will help you with the results
>>page. I don't know why you need to create an anonymous form
>>otherwise than with a .shtml page.
>>
>>
>>Because the anonymous form is on "site" i.e. created with
>>modules/site, the only .shtml is a page containing<!--#include
>>site.php3?....-->, so I take the PHP generated and put it into the
>>site module, the URL on success is just '?i=10' meaning to go to
>>item 10, which would be the thankyou page, and then "i=11" for
>>failure, but I can't figure out what to put into the failure page.
>>
>>
>>I can't put a SHTML include there, or PHP, all I can really put
>>there is something inside {....} and have stringexpand.php3 expand
>>it. I COULD put an {include} here if I could figure out what to
>>put inside it, but it would make much more sense to do it directly
>>with a {...} IF I COULD FIGURE OUT HOW THE RESULT IS STORED.
>>
>>
>>>I think the SSI includes do most resemble the readfile() PHP
>>>function. You only need to pass the post2sthml_id parameter to the
>>>PHP scripts called by readfile().
This didn't work, what I ended up doing was
1: in site site config file (site/sites/site_bayfm.php3) define a
function "myfillform" that called add_post2shtml to get the array,
build an error message and return it
2: Insert that into $GLOBALS[eb_functions] so that it will be expanded when....
3: Put {myfillform} into the site definition at the point I want the
error message to appear.
Note my example only shows validate errors, and it doesn't do the
part about setting fields for editing records. I haven't figured out
how to do that, and don't need it for what I'm doing.
modules/site/sites/site_bayfm.php3 is checked into CVS as an example.
>>When really complex stuff like this isbuilt, could you generate
>>some ARCHITECTURE documentation, as well as the docs like
>>anonym.html AND an example. Things that are obvious to the coder,
>>just aren't obvious to someone else looking at it. For example in
>>this case ..... we need to know. ...(this is just an example, I
>>KNOW that I don't have it right, because I don't understand how
>>this is working)
>>
>>
>>1: insert_fnc_xxx generate errors like
>>$GLOBALS[err][headline........] = "This string is too long"
>>
>>2: filler.php3 martials these and stores them in its own
>>$err[validate] (NOTE THIS IS REUSE OF THE GLOBAL, THIS NEW
>>$err HAS A DIFFERENT STRUCTURE FROM THE $err filled by
>>insert_fnc_xxxx
>>
>>3: The result is stored somewhere ...
>>
>>4: The id parameter is passed back ... how?
>>
>>4: fillform.php3 gets this parameter from the URL which is the id
>>field of the xxxx table
>>
>>and so on .....
>>
>>>This documentation can be quite brief, but its crucial to being
>>>able to debug. Without something like this, its impossible to
>>>trace a bug back and know which step is doing it wrong, and there
>>>is a real danger that one coder will go in and "FIX" something
>>>which isn't a bug, and therefore break something else.
This would still be useful - on each of the things you have done
where there is tricky behavior (like storing intermediate results in
arrays, serializing them and putting them in a database table!
>>>1: The insert_fnc_fil etc functions don't always set $err[xxx] but
>>>either return a value, or set $err (string) etc
These bugs are still there in many places
>>>2: Some validate functions return an error, even if there is not
>>>one - for example if you try and post an anonymous form NOT
>>>containing a publish date, to a slice where Publish_date is marked
>>>as required&show then it will generate an error, rather than using
>>>the default
See separate thread - Honza reckons this SHOULD be an error
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
|
|
From: Jakub A. <jak...@se...> - 2003-03-08 19:46:13
|
Mitra, I have enhanced the comments in post2shtml.php3 and in
anonym.xml, now it will be hopefully better comprehensible.
Jakub
-----Original Message-----
From: apc...@li...
[mailto:apc...@li...] On Behalf Of Mitra
Sent: Thursday, March 06, 2003 11:25 PM
To: Jakub Adamek; apc...@so...
Subject: RE: [Apc-aa-coders] Forms and error handling
At 10:32 PM +0100 6/3/03, Jakub Adamek wrote:
Mitra,
ad 3: I can not find the bug with StoreItem. Could you help me?
Everything is working fine for me. I have commented the rows in again.
Please could you try to comment out individual functions in
event_handler.php3 (like AuthUpdateReaders etc.) so that I know which
function caused troubles? Or could you give me some access to some
pages?
Ok - I will look into this deeper, I think I still have a form that will
generate the problem if I uncomment those lines.
ad 4: This was a new bug. Thanks for finding it. Fixed.
ad 5: I have created an example in doc/script/show_result.php3
Thanks - that script is useful,
ad 6: I will try to make the FAQ consistent with doc/anonym
ad 8: I am not sure what was your problem. The wizard creates the code
for a .shtml page. Of course the code is created by a PHP script. I
changed a bit the documentation in doc/anonym to clarify this point.
Where is this SHTML page created? When I run the wizard I get a PHP3
page,
I choose the slice, SliceAdmin / Anon Form Wiz ; change the URL; Click
Show Form and I get a screen anonym_wizard.php3 with NO SHTML that I
can find. This is the code for the PHP3 page, not for the SHTML page?
I hope doc/script/show_result.php3 will help you with the results page.
I don't know why you need to create an anonymous form otherwise than
with a .shtml page.
Because the anonymous form is on "site" i.e. created with modules/site,
the only .shtml is a page containing<!--#include site.php3?....-->, so I
take the PHP generated and put it into the site module, the URL on
success is just '?i=10' meaning to go to item 10, which would be the
thankyou page, and then "i=11" for failure, but I can't figure out what
to put into the failure page.
I can't put a SHTML include there, or PHP, all I can really put there is
something inside {....} and have stringexpand.php3 expand it. I COULD
put an {include} here if I could figure out what to put inside it, but
it would make much more sense to do it directly with a {...} IF I COULD
FIGURE OUT HOW THE RESULT IS STORED.
I think the SSI includes do most resemble the readfile() PHP function.
You only need to pass the post2sthml_id parameter to the PHP scripts
called by readfile().
Sorry, I don't understand what you mean here at all, could you give an
example. How do I get this post2shtml_id parameter? I'm assuming it is
generated by filler.php3 somehow? Is it appended to the err_url?
Can I make a suggestion .....
When really complex stuff like this isbuilt, could you generate some
ARCHITECTURE documentation, as well as the docs like anonym.html AND an
example. Things that are obvious to the coder, just aren't obvious to
someone else looking at it. For example in this case ..... we need to
know. ...(this is just an example, I KNOW that I don't have it right,
because I don't understand how this is working)
1: insert_fnc_xxx generate errors like $GLOBALS[err][headline........] =
"This string is too long"
2: filler.php3 martials these and stores them in its own $err[validate]
(NOTE THIS IS REUSE OF THE GLOBAL, THIS NEW $err HAS A DIFFERENT
STRUCTURE FROM THE $err filled by insert_fnc_xxxx
3: The result is stored somewhere ...
4: The id parameter is passed back ... how?
4: fillform.php3 gets this parameter from the URL which is the id field
of the xxxx table
and so on .....
This documentation can be quite brief, but its crucial to being able to
debug. Without something like this, its impossible to trace a bug back
and know which step is doing it wrong, and there is a real danger that
one coder will go in and "FIX" something which isn't a bug, and
therefore break something else.
- Mitra
-----Original Message-----
From: apc...@li...
[mailto:apc...@li...] On Behalf Of Mitra
Sent: Thursday, March 06, 2003 1:17 PM
To: hon...@ec...; apc...@so...
Subject: [Apc-aa-coders] Forms and error handling
Hi Honza
thanks for the Yahoo chat, at least I think we are getting closer to
solving some of this mess.
As I see it, we have at least 6 sets of bugs to deal with
So there are at least x bugs
1: The insert_fnc_fil etc functions don't always set $err[xxx] but
either return a value, or set $err (string) etc
2: Some validate functions return an error, even if there is not one -
for example if you try and post an anonymous form NOT containing a
publish date, to a slice where Publish_date is marked as required&show
then it will generate an error, rather than using the default
3: StoreItem crashes when it calls the event code when running off an
anonymous form I've commented that call out in the CVS version until
someone (Jakub?) fixes the bug.
4: filler.php3 ALWAYS calls the err_url because $err is ALWAYS an array
even if it contains just "success". This was probably never spotted
since the wizard uses the same URL for both. I'm going to assume that
the array is correct, and the code is wrong, since anonym.html mentions
"success".
5: Insufficient documentation on how to create an error page that will
display the error. See http://aa.ecn.cz/apc-aa-dev/doc/anonym.html. for
some docs, but even after reading these I'm having difficulty figuring
out how to build a simple page (to go in err_url) that displays the
error from the $err array and prompts the user to fix the problem - its
even harder since what I really want is to set err_url to
"mysite.shtml?i=99" since this is all driven by the "site" module, so I
have to understand what is happening in order to modify it to do what I
need.
6: The Documentation there is i.e. anonym.html isn't linked into either
doc/index.html or the FAQ, so in effect it doesn't exist! PLEASE
PLEASE LINK ALL DOCUMENTATION SO SOMEONE CAN FIND IT AGAIN
7: The FAQ is inconsistent with anonym.html, i.e.
http://apc-aa.sourceforge.net/faq/#anonymous still says to cut and paste
from "Add Item" instead of using the wizard.
8: anonym.html says "This wizard creates a complete form with the SSI
include of fillform.php3 necessary to edit items. The resulting form
differs depending on whether Anonymous editing is allowed or not." That
is not what it appears to do - it outputs a PHP form, with no SSI.
This might sound trivial, but we lost at least a day or more of work
trying to figure it out (without seeing anonym.htm) and then looking for
why it didn't work properly.
I'm going to start fixing some of these bugs tomorrow, so please say
something if I'm missing something - especially with items 1,2 or 4
I'd appreciate some help with figuring out how to do the results page,
ideally within a "site" i.e. from within PHP3, with no access to SHTML.
I've introduced the concept of a current item in the site, (you can see
this in site_bayfm.php3) using this might be the best mechanism to get
at the posted data, but I'm not sure about that?
- Mitra
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
--
Mitra Technology Consulting - www.mitra.biz - mi...@mi...
02-6684-8096 or 0414-648-0722
Life is a Mystery to be Lived, not a Problem to be Solved
|