You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(136) |
Feb
(104) |
Mar
(80) |
Apr
(21) |
May
(36) |
Jun
(18) |
Jul
(22) |
Aug
(5) |
Sep
(11) |
Oct
(7) |
Nov
(3) |
Dec
(12) |
2004 |
Jan
(5) |
Feb
|
Mar
(3) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(3) |
Aug
(6) |
Sep
(3) |
Oct
(4) |
Nov
(4) |
Dec
|
2005 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(7) |
May
(4) |
Jun
(7) |
Jul
(4) |
Aug
(4) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(1) |
2006 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(4) |
May
|
Jun
(6) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(3) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
(4) |
Mar
(7) |
Apr
(4) |
May
(4) |
Jun
(8) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
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: 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: Jakub A. <jak...@se...> - 2003-03-06 21:33:28
|
Mitra, the .shtml page has not access to these variables, but all the PHP scripts SSI-included into this page can. The principles are described in the post2shtml.php3 script. Jakub > -----Original Message----- > From: apc...@li... > [mailto:apc...@li...] On Behalf Of Mitra > Sent: Monday, March 03, 2003 11:19 PM > To: Jakub Adamek; apc...@so... > Cc: ra...@pa... > Subject: RE: [Apc-aa-coders] Re: anonymous form filling > > > I don't remember any description of post2shtml and don't find > anything in the apc-aa.sourceforge.net/faq > > So how is the .shtml page supposed to access these variables? > > - Mitra > > At 11:35 AM +0100 3/3/03, Jakub Adamek wrote: > >Hi all, > > > >I see Honza already answered this, but my answer adds some > details so I > >am sending it as well. > > > >I hope I already described the lovely feature post2shtml: > There is no > >way to POST to a .shtml page, you must always use the GET > method, which > >has several disadvantages. Thus I created a PHP script > post2shtml.php3, > >the variables are sent to it and stored to database. Than you are > >redirected to the .shtml page and PHP scripts called through SSI > >includes retrieve againt the variables from the database. > > > >The table post2shtml is a part of sql_update.php3, just create it. > > > >Jakub > > > >> -----Original Message----- > >> From: apc...@li... > >> [mailto:apc...@li...] On Behalf Of > >> Mitra > >> Sent: Wednesday, February 26, 2003 10:25 PM > >> To: apc...@so... > >> Cc: ra...@pa... > >> Subject: [Apc-aa-coders] Re: anonymous form filling > >> > >> > >> Ram - the main problem seems to me that the table this is > being sent > >> to - post2shtml - doesn't exist. > >> > >> I don't understand how this works, or where you set the > table for it > >> to go to ...... I thought anonymously posted items got added as > >> regular items in some slice or other. > >> > >> - Mitra > >> > >> > >> At 12:59 AM +0530 27/2/03, Ram Prasad wrote: > >> >Mitra > >> > > >> >I was trying out the anonymous form filling wizard for > my Taskss > >> Slice. >The form got created fine. I clicked on send, without > >> providing any >values (a blank form) and got the > following dump on > >> the > >> screen: (should > >> >it have not just complained about the values not being > there ?) > > >> >Database error: Invalid SQL: INSERT INTO post2shtml (id, > vars, time) > >> >VALUES ('b24442e11fdfa9dc45c04fca69e844a1', > >> >'a:4:{s:4:\"post\";a:25:{s:7:\"err_url\";s:31:\"http://FILL_Y > >OUR_PAGE_U > >> >RL.sh > tml\";s:6:\"ok_url\";s:31:\"http://FILL_YOUR_PAGE_URL.shtml\" > >> ;s:8:\"slice_id > > > >\";s:32:\"cd5409ecfbeba5303da25590203d7d03\";s:14:\"use_post2 > > > shtml\";s:1:\"1 > > > >\";s:10:\"my_item_id\";s:0:\"\";s:45:\"edtv686561646c696e652e > > > 2e2e2e2e2e2e2e_ > > > >FontName\";s:1:\"0\";s:45:\"edtv686561646c696e652e2e2e2e2e2e2 > >> e2e_FontSize\"; > >> >s:1:\"0\";s:33:\"v686561646c696e652e2e2e2e2e2e2e2e\";s:0:\"\" > >> ;s:37:\"v686561 > >> >646c696e652e2e2e2e2e2e2e2ehtml\";s:1:\"h\";s:33:\"v6162737472 > >> 6163742e2e2e2e2 > >> >e2e2e31\";s:4:\"Mark\";s:45:\"edtv66756c6c5f746578742e2e2e2e2 > >> e2e2e_FontName\ > >> >";s:1:\"0\";s:45:\"edtv66756c6c5f746578742e2e2e2e2e2e2e_FontS > >> ize\";s:1:\"0\" > >> >;s:33:\"v66756c6c5f746578742e2e2e2e2e2e2e\";s:0:\"\";s:37:\"v > >> 66756c6c5f74657 > >> >8742e2e2e2e2e2e2ehtml\";s:1:\"h\";s:33:\"v63617465676f72792e2 > >> e2e2e2e2e2e2e\" > >> >;s:11:\"In_Progress\";s:33:\"v746578742e2e2e2e2e2e2e2e2e2e2e3 > >> 2\";s:0:\"\";s: > >> >33:\"v746578742e2e2e2e2e2e2e2e2e2e2e31\";s:0:\"\";s:33:\"v656 > >> e645f646174652e > >> >2e2e2e2e2e2e31\";s:0:\"\";s:45:\"edtv61627374726163742e2e2e2e > >> 2e2e2e32_FontNa > >> >me\";s:1:\"0\";s:45:\"edtv61627374726163742e2e2e2e2e2e2e32_Fo > >> ntSize\";s:1:\" > >> >0\";s:33:\"v61627374726163742e2e2e2e2e2e2e32\";s:0:\"\";s:37: > >> \"v616273747261 > >> >63742e2e2e2e2e2e2e32html\";s:1:\"h\";s:4:\"send\";s:4:\"Send\ > >> ";s:6:\"result\ > >> >";a:1:{s:8:\"validate\";a:2:{s:33:\"v686561646c696e652e2e2e2e > >> 2e2e2e2e\";s:54 > >> >:\" > >> >Error in Task (it must be filled) > >> >\";s:33:\"v746578742e2e2e2e2e2e2e2e2e2e2e32\";s:63:\" > >> >Error in Received Date (it must be filled) > >> >\";}}s:13:\"oldcontent4id\";a:34:{s:16:\"headline........\";a > >> :1:{i:0;a:2:{s: > >> >5:\"value\";s:0:\"\";s:4:\"flag\";i:1;}}s:16:\"abstract...... > >> .1\";a:1:{i:0;a > >> >:2:{s:5:\"value\";s:4:\"Mark\";s:4:\"flag\";i:0;}}s:16:\"full > >_text.......\"; > >> >a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:1;}}s:16: > >> \"category..... > >> >...\";a:1:{i:0;a:2:{s:5:\"value\";s:11:\"In_Progress\";s:4:\" > >flag\";i:0;}}s: > >> >16:\"text...........2\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\"; > >> s:4:\"flag\";i: > >> >0;}}s:16:\"text...........1\";a:1:{i:0;a:2:{s:5:\"value\";s:0 > >> :\"\";s:4:\"fla > >> >g\";i:0;}}s:16:\"end_date.......1\";a:1:{i:0;a:2:{s:5:\"value > >> \";s:0:\"\";s:4 > >> >:\"flag\";i:0;}}s:16:\"abstract.......2\";a:1:{i:0;a:2:{s:5:\ > >> "value\";s:0:\" > >> >\";s:4:\"flag\";i:1;}}s:16:\"highlight.......\";a:1:{i:0;a:2: > >> {s:5:\"value\"; > >> >i:0;s:4:\"flag\";i:0;}}s:16:\"link_only.......\";a:1:{i:0;a:2 > >> :{s:5:\"value\" > >> >;s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"hl_href.........\";a:1:{i > >> :0;a:2:{s:5:\"v > >> >alue\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"created_by......\"; > >> a:1:{i:0;a:2:{s > >> >:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"e_posted_by.. > >> ...\";a:1:{i:0; > >> >a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"source. > >.........\";a:1 > >> >:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"s > >ource_href..... > >> >\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s: > >> 16:\"place..... > >> >......\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i: > >> 0;}}s:16:\"expi > >> >ry_date.....\";a:1:{i:0;a:2:{s:5:\"value\";i:1219042800;s:4:\ > >"flag\";i:0;}}s > >> >:16:\"publish_date....\";a:1:{i:0;a:2:{s:5:\"value\";i:104628 > >7486;s:4:\"flag > >> >\";i:0;}}s:16:\"lang_code.......\";a:1:{i:0;a:2:{s:5:\"value\ > >";s:2:\"EN\";s: > >> >4:\"flag\";i:0;}}s:16:\"cp_code.........\";a:1:{i:0;a:2:{s:5: > >> \"value\";s:9:\ > >> >"iso8859-1\";s:4:\"flag\";i:0;}}s:16:\"img_src.........\";a:1 > >> :{i:0;a:2:{s:5: > >> >\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"img_width....... > >> \";a:1:{i:0;a:2 > >> >:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"img_height > >> ......\";a:1:{i > >> >:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"edit > >_note.......\"; > >> >a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16: > >> \"slice_id..... > >> >...\";a:1:{i:0;a:2:{s:5:\"value\";s:1:\"1\";s:4:\"flag\";i:0; > >> }}s:16:\"post_d > >> >ate.......\";a:1:{i:0;a:2:{s:5:\"value\";i:1046287486;s:4:\"f > >> lag\";i:0;}}s:1 > >> >6:\"status_code.....\";a:1:{i:0;a:2:{s:5:\"value\";s:1:\"1\"; > >> s:4:\"flag\";i: > >> >0;}}s:16:\"edited_by.......\";a:1:{i:0;a:2:{s:5:\"value\";s:0 > >> :\"\";s:4:\"fla > >> >g\";i:0;}}s:16:\"posted_by.......\";a:1:{i:0;a:2:{s:5:\"value > >> \";s:0:\"\";s:4 > >> >:\"flag\";i:0;}}s:16:\"last_edit.......\";a:1:{i:0;a:2:{s:5:\ > >> "value\";i:1046 > >> >287486;s:4:\"flag\";i:0;}}s:16:\"display_count...\";a:1:{i:0; > >a:2:{s:5:\"valu > >> >e\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"disc_count......\";a: > >> 1:{i:0;a:2:{s:5 > >> >:\"value\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"disc_app...... > >> ..\";a:1:{i:0;a > >> >:2:{s:5:\"value\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"flags.. > >.........\";a:1 > >> >:{i:0;a:1:{s:5:\"value\";i:32;}}}}s:3:\"get\";a:0:{}s:5:\"fil > >> es\";a:0:{}s:6: > >> >\"cookie\";a:0:{}}', 1046287486) > >> >MySQL Error: 1146 (Table 'aadb.post2shtml' doesn't > exist) Please > >> >contact mi...@ea... and report the exact error message. > >> >Session halted. > >> > >> > >> -- > >> 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 > >> > >> > >> > >> ------------------------------------------------------- > >> This SF.net email is sponsored by: Scholarships for > Techies! Can't > >> afford IT training? All 2003 ictp students receive > scholarships. Get > >> hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. > >> www.ictp.com/training/sourceforge.asp > >> _______________________________________________ > >> Apc-aa-coders mailing list Apc...@li... > >> https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > >> > > > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > _______________________________________________ > >Apc-aa-coders mailing list > >Apc...@li... > >https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > > -- > 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 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of > TotalView, The debugger > for complex code. Debugging C/C++ programs can leave you > feeling lost and > disoriented. TotalView can help you find your way. Available > on major UNIX > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > |
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: Jakub A. <jak...@se...> - 2003-03-06 21:33:16
|
The design of index.php3 seems a bit broken. I have added the <tr><td> tags around the Item Manager view. I hope it is OK but if not just find the commented rows around 568 in index.php3. Jakub |
From: Jakub A. <jak...@se...> - 2003-03-06 21:33:15
|
03/06/03 - fixed (?) design of index.php3 with <tr><td> around item manager view (jakub) 03/06/03 - changed some labels in Alerts (jakub) 03/06/03 - fixed filler.php3 so that it does not call ErrPage when everything OK (jakub) 03/06/03 - reorganized the module select box to groups by module / slice type (jakub) 03/06/03 - added an image to the title of Reader Management slices and to the title of Alerts (jakub) |
From: Mitra <mi...@ea...> - 2003-03-06 12:17:49
|
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 12:17:01
|
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 05:21:34
|
I'm seeing something odd with the Safari browser, I've got a site file at www.byronbayfm.org.au/draft.shtml On this I have relative URLs e.g. "?i=39" for example, instead of appending these to the file - e.g. www.byronbayfm.org.au/draft.shtml?i=39 it appends to root www.byronbayfm.org.au/?i=39 Ick .... completely wrong place. I wondered if anyone has Safari and could confirm / deny this, (you can use that site) if so please let me know the version of your browser. - 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 <mit...@ea...> - 2003-03-06 03:25:20
|
OK Thanks for the explanations. Two points. OK - I agree that it would be better to store the same URL twice in the case of no resampling required. However there was no way in your code to distinguish between the case of NO-SAMPLING-REQUIRED and the case of SAMPLING-REQUIRED-BUT-NOT-POSSIBLE. Ok - so that $thumbnails code isn't wrong, its just very ugly ! Having spent a lot of time trying to figure out this code it looked like a bug to me, especially since I'd already found one bug like this in the same file (the use of $f) if you are going to do something as ugly as this then it at least needs a comment. I've added one ... I've committed my changes to CVS - which are working on this system, including several cases where the original code failed, and lots of debugging to help figure out what is going on (set $debugupload=1 to test, but note it will exit on failure if debugupload is set - as otherwise the error message is lost in the redirect ). - Mitra At 7:13 PM +0100 5/3/03, Norbert Brazda wrote: >Hi Mitra, > >I will try to do English translation for Stano: > > >> > it would have been useful if you had answered my other points as >> > well, I have made quite a number of fixes in that code, fixes to real >> > problems that I hit. These are fixes that I'd like to commit to CVS >> > so that I can use them on other installations. The main change is to >> > the behavior when it cannot or does not need to do a resample. I have >> > ResampleImage to the copy in those cases, this change allowed me to >> > fix a number of bugs that I found with different situations. > >Stano thinks that you changes should be OK but he did not have time >to test it. There is just one comment: There is no need to make >multiple copies of the same image file (in case of no need for >resampling) as it should be enough to store just reference (URL) to >that file in respective field(s) which is current logic. > > >> > Also - that second item IS a bug, $thumbnails is NOT defined in the >> > CVS version in function Store_Item, it doesn't matter what you are >> > doing to it IF IT IS NOT DEFINED! > > > >// POINT1 > >if ($fnc["fnc"]=="fil") > { >// POINT2 > if (is_array($thumbnails)) { > reset($thumbnails); > while(list(,$v_stop) = each($thumbnails)) > if ($v_stop==$fid) $stop=true; > }; >// POINT3 > if (!$stop) > $thumbnails = $fncname($id, $f, $v, >$fncpar["param"], $fields); > > // newly added = we reset $stop variable back to false: > $stop=false; > > } >// POINT4 > else > $fncname($id, $f, $v, $fncpar["param"]); > > > >Here is the logic (correct me if I am wrong): > >--- first loop --- > >* if you fill-in file upload field on input form, the first >condition (POINT1) is met > >* $thumbnails is not yet defined (POINT2) so we continue with next condition > >* $stop is not defined so the condition (POINT3) is met and we >execute $fncname function > > * if there are no thumbnail fields defined in parameters to the >current field, > image is uploaded, $thumbnails is set empty > > * if there is one or more thumbnail fields defined in parameters >to the current > field, image is resized according to parameters in these >fields and URLs to > the resized images are stored in respective fields; >$thumbnails array is filled > by IDs of those fields we filled (WE WILL CONTINUE WITH THIS OPTION) > >--- next loop --- > >we are processing some other field from the input form >field is of type input text, so the first condition (POINT1) is not >met, we continue with normal processing (POINT4) > >--- next loop --- > >* there is another file upload field so we go to process it (POINT1) > >* thumbnails is already set from the first loop so we process it (POINT2) > > * we go through array and compare current field ID ($fid) with >image fields that we have > already filled in the first loop. If it is equal, we set >$stop to true. > > * $stop is true so we skip this condition (POINT3) -field is >already filled, so we do not want to > execute $fncname() > > * we already used $stop variable co we can set it back to false > >--- next loop --- > >etc... > > > > > >Norbert Brazda >br...@ch... >tel: 0905-729359 > >ChangeNet - informacny servis o obcianskej spolocnosti >Mlynske nivy 41, 821 09 Bratislava, Slovakia >tel/fax: 02-55560026, eMail: in...@ch... >http://www.changenet.sk > >SPAJAME LUDI, KTORI MENIA SVET -- 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 03:14:56
|
I've commented out the calls to Event_ItemAfterInsert in the CVS version of StoreItem, This call leads to a crash as reported it on here a couple of days ago, when the bug is fixed it should be commented back in! Note - in the unlikely event that Alerts *are* working for you, then you'll want to comment this back in (Ram couldn't get it to work, and I had the calling code crash). - 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 <mit...@ea...> - 2003-03-06 01:47:56
|
Hi Adolfo I don't know what is going on here. I *have* seen problems with the current versions of PHP etc, but the (se have not been addressed yet by the people whose code is effected. (Too many tasks, too few programmers!) Honza .... what version are you and Jakub developing on, I get the impression you are developing on non-current versions of PHP which is why we are seeing problems like redefined functions, or register_globals etc . - Mitra At 3:45 PM -0600 4/3/03, Adolfo Dunayevich wrote: >note: I am cc'ing to some folks as the mailling list seems to be broken. > > >Thanks Honza and Marek. That was the problem with sql_update. >( register_globals=On ). >I did not pay attention to that detail in docs. >Now I read the whole think :-) > >now 2 problems: > >I stick with cvs version and php4. > >When I login as a normal user I can login normally >When I login as admin user (i.e. superuser) the system responds > > "No slice found for you" (on cvs version) >or > "You do not have permission to edit items in this slice" (on 2.4 version) > >I already tried to recover the account from setup.php3 w/o success > > >the other problem > >login in as a normal user I have access to the corresponding slices >of the user. >when I try to do any transaction, lets say add an item, update >setting for a slice, etc, >I *can* do the transaction, but when I press the send button for the >corresponding action, >I get a new screen from the browser saying: > >The page cannot be displayed The page you are looking for is >currently unavailable. The Web site might be experiencing technical >difficulties, or you may need to adjust your browser settings. > >that occurs with mostly all of the transactions. If I check, for >example, for an added item, it was added. >the problem is the display of the next screen. > >adolfo > > >adolfo > > >At 09:36 a.m. 04/03/2003 +0100, Marek Tichy wrote: >> > ok, lets say I run sql_update under pgp4. >>> no parse error BUT sql_update just does not run! >>> I press the button and the same screen shows again with no action. >>> I can put a good or bad password and the result is the same, no >>>error message. >> >>It looks like you don't have register_globals=On in your php.ini or >>apache config. >>For more info, read installation documentation that comes with AA >>package under /doc >> >> >>Best >> Marek -- 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: Honza M. <hon...@ec...> - 2003-03-04 23:07:44
|
Hi Mitra, I'm sending it also in the list, since other developers could have some suggestions, too. On =DAt, 2003-03-04 at 22:25, Mitra wrote: > At 3:38 PM +0100 4/3/03, Honza Malik wrote: > >Hi Mitra, > > > >On =DAt, 2003-03-04 at 00:59, Mitra wrote: > >> Honza > >> > >> I'm looking at some of the caching problems - are you able to help = a > >> bit, with understanding things that seem strange to me? > >> > >> I'm particularly looking at this with the site module. > >> > >> The first odd thing i notice ..... > >> > >> Store gets called a lot which is fine, BUT lastClearTime is always = 0, > >> so it calls purge every time, that makes for 6 extra "DELETE FROM > >> pagecache WHERE stored < ..." calls on each of my site pages. > > > >You are right - the concept of lastClearTime is not good - you never > >know the lastClearTime. > > > >> It looks like this is because each call is with a "new PageCache", > >> some in GetView and the others in get_output_cached > >> > >> I see two solutions to this > >> 1: Easy: Delete the purge from the store, really purge should be > >> happening at the retrieval side, not at the storing! > >> > >> 2: Remove the "new PageCache" from everywhere, do it once and keep = it > >> in a global variable $GLOBALS[pagecache] > > > >I think it does not help. If one script deletes the cache and do not > >store the time to some table, noone can know, when it was. We can stor= e > >it into log table. >=20 > This might be ideal, but the problem is much worse than this - at the=20 > moment purge is called MANY times by ONE script, which means we could=20 > remember it within a script. If we will purge() cache from special script, then no calling in other scripts is needed. If we won't use special script, you are right. > >The best solution, I think, is to call purge() from AA cron. The cache > >was written in time, then AA cron wasn't in AA, so there was no such > >possibility. Now we can move it here. > > > >I think it should not be problem. Anyway. I plan to write script > >db_maintain.php3 which will be runed each 5 minutes from AA cron. Ther= e > >I want to move managing count Hits (Item display count). Marek found > >some inefficiecy in count hit - if a user searches in AA, noone can vi= ew > >fulltext!!! - it waits until the searching is done and after that it > >updates display_count in item table. After that the fulltext is shown. > >It is quite bad. >=20 > I don't think its a good idea to rely on Cron, it requires access to=20 > the system that many cases won't have - I find this when I'm doing=20 > work for some organization who are hosting their site on some ISP,=20 > not on their own machine. Often this hosting is a gift by the ISP to=20 > the organization, so they don't always give it top priority. That's right but I do not see better solution. What about to create special service (say at Econnect or SourceForge) which will create HTTP request to cron.php3 on remote AA installs for such organizations (each 5 minutes)? (I'm sure there must be such service on the web already.) > I find the search/fulltext issue quite surprising, can you say more=20 > about where this lock happens - is it in MySQL or in PHP ? And what=20 > has this got to do with Counting Hits? Or do you mean that it is=20 > because the fulltext view is trying to update the table, and can't do=20 > this until the Search finishes? Yes, exactly. It is MySQL issue. If MySQL do the SELECT from item joined with content table, the tables are locked (at least in MySQL <4) and all UPDATEs must wait until the SELECT is executed. > >We can fix it, if we write the hit to another table. We plan to use lo= g > >table, where we log the hit and then we run db_maintain.php3 from cron. > >The script will count all loged hits and then update database > >(item.display_count). There is no problem, if the script will call als= o > >purge() for cache. The purge events could be written into log database > >as well, so we will know, when last purge() was run. >=20 > Another solution MIGHT be to do the hitcount update AFTER all page=20 > output has been done, that way we don't care if the script waits a=20 > second or two? No way. We can't use it with shtml files, because SSI includes MUST wait after whole script is executed. After then it can continue display next part of shtml file. Also, MySQL do not have any UPDATE DELAYED command. It has only REPLACE DELAYED, which we can't use, because the autoincremented short_id is changed on each REPLACE. > > > What do you think - I think I prefer version 2, although its more > >> work ... if we did it in just the retrieval side (i./e. ignoring it > >> in /admin/) it would fix most of the inefficiencies. > >> > >> The next thing I notice is that even if nocache=3D1 it is still sto= ring > >> stuff in the cache (again from get_output_cached and GetView) > > > >This is designed behavior - mostly you want just renew chache content > >and show it. Maybe just the name 'nocache' is not good. >=20 > Ok - this is fine, I thought nocache meant not using the cache at all. > > - Mitra Honza |
From: Honza M. <hon...@ec...> - 2003-03-04 21:52:25
|
On =DAt, 2003-03-04 at 12:11, Mitra wrote: > Any more thoughts on this? >=20 > I've fixed it on my copy by setting register_globals on, but many > people installing APC-AA won't have access to php.ini Sure, we have to fix it. > At 9:54 AM +1100 26/2/03, Mitra wrote: > > Maybe it is not so much work .... > > We have code that is all over the place > > if (!get_magic_quotes_gpc()) { > > // Overrides GPC variables > > if( isset($HTTP_GET_VARS) AND is_array($HTTP_GET_VARS)) > > for (reset($HTTP_GET_VARS); list($k, $v) =3D each($HTTP_GET_VARS)= ; > > ) > > $$k =3D Myaddslashes($v); > > if( isset($HTTP_POST_VARS) AND is_array($HTTP_POST_VARS)) > > for (reset($HTTP_POST_VARS); list($k, $v) =3D > > each($HTTP_POST_VARS); ) > > $$k =3D Myaddslashes($v); > > if( isset($HTTP_COOKIE_VARS) AND is_array($HTTP_COOKIE_VARS)) > > for (reset($HTTP_COOKIE_VARS); list($k, $v) =3D > > each($HTTP_COOKIE_VARS); ) > > $$k =3D Myaddslashes($v); > > } > > We could change MyAddSlashes to set the GLOBALS, variables if > > register_globals was off? Yes, it is quick and dirty solution. We can copy all variables from $_GET, $_POST, $_SERVER, $_COOKIE, ... variables to the $GLOBALS in MyAddSlashes() or similar function. It will work. On the other hand the $_GET, ... superglobal variables was introduced because of bigger security of the code. If we register ALL variables from superglobals arrays, we loose this advantage of security. So, I agree we can do it as quick solution, but if we want to benefit from security advantages of superglobal variables, we have to rewrite the current code to use it. My suggestion is to use superglobal variables at least in newly written code, for now. Note: We can use import_request_variables() function to do it - See: http://www.php.net/manual/function.import-request-variables.php > > Anyway - shouldn't this be an include, since we do it the same way > > almost everywhere? Yes, good idea. > > I can see that include/config.php3 is called after this but I > > can't see anything in config.php3 that depends on these variable, so > > we could just call a script, say > > $GLOBALS[AA_INC_PATH]/setvariables.php3 AFTER config.php. > > I think the code would also need to handle a few extra variables > > like $DOCUMENT_ROOT becoming $_SERVER['DOCUMENT_ROOT'] It's the same problem as with $_GET, ... only the replace to right form is easier - we know all possible variable names. Note: be carefull with the search and replace - the superglobal arrays are supported from PHP v4.1.0, but AA should support PHP v4.0.6 > > This could be easily done with a Tags-find-replace since we aren't > > changing functionality, only variable names. The hard part is that > > we need to work in the pre 4.2.0 case as well, so it might be best > > to do it all in include/setvariables.php3 e.g. > > if somecall(register_globals) { /// Not sure how to test this > > $DOCUMENT_ROOT =3D $_SERVER['DOCUMENT_ROOT'] > > } if( ini_get('register_globals') ) ...=20 Honza > > Thoughts .... > > - Mitra > > At 1:29 PM +0100 25/2/03, Honza Malik wrote:=20 > > > Hi Mitra, > > >=20 > > > I think you upgraded PHP to version >=3D4.2.0, where PHP > > > configuration > > > directive register_globals is set to OFF by default. Current AA > > > runs > > > only with the register_globals set to ON. We should change the > > > code of > > > AA to use superglobals variables $_GET, $_POST, $_COOKIE, ..., but > > > is > > > uis quite a lot of work. On the other hand, the new settings of > > > PHP > > > (register_globals=3DOFF) is safer, so we should do it. > > >=20 > > > See > > > http://www.php.net/manual/en/language.variables.predefined.php#lang= uage.variables.superglobals > > >=20 > > > Honza > > >=20 > > > On P=E1, 2003-02-21 at 14:02, Mitra wrote: > > > > Hi > > > > > > > > Something seems to have changed on my home system, so that > > > global > > > > variables aren't getting set. I don't think its an APC change > > > > because a backup version stopped working as well. I have > > > upgraded > > > > the OS (Mac OSX) recently so its possible that a config file > > > > changed, so I'm really looking for help to find out what > > > changed. > > > > > > > > There is NO php.ini in use. > > > > > > > > I've look on include/init_page and get_magic_quotes_gpc() is > > > returning 1 > > > > so the piece of code that sets the variables isn't being run. > > > > > > > > If that code is NOT run, then how are the variables set from the > > > URL > > > > i.e. from HTTP_GET_VARS? > > > > > > > > - 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 > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: SlickEdit Inc. Develop an > > > edge. > > > > The most comprehensive and flexible code editor you can use. > > > > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day > > > Trial. > > > > www.slickedit.com/sourceforge > > > > _______________________________________________ > > > > Apc-aa-coders mailing list > > > > Apc...@li... > > > > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > Apc-aa-coders mailing list > > > Apc...@li... > > > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > -- > > Mitra Technology Consulting - www.mitra.biz - mi...@mi... > > 02-6684-8096 or 0414-648-0722=20 > >=20 > > Life is a Mystery to be Lived, not a Problem to be Solved >=20 >=20 >=20 > --=20 > Mitra Technology Consulting - www.mitra.biz - mi...@mi... > 02-6684-8096 or 0414-648-0722=20 >=20 > Life is a Mystery to be Lived, not a Problem to be Solved >=20 |
From: Mitra <mi...@ea...> - 2003-03-04 21:41:48
|
OK - now I understand your point. I think that creating connections DOES take resources, especially if the database is remote to the web server, or has a slow authentication process. - Mitra At 1:33 PM +0100 4/3/03, Jakub Adamek wrote: >Mitra, > >I understand you fully. But my idea is you don't need to create a >database pool if it takes no time and resources to create a new >connection. Just delete or "global $db" and each function creates >its own connection (or reuses a persistent one). But it would be >necessary to measure whether this approach will or won't take too >much time or memory. > >Jakub > >-----Original Message----- >From: apc...@li... >[mailto:apc...@li...] On Behalf Of Mitra >Sent: Monday, March 03, 2003 11:16 PM >To: Jakub Adamek; apc...@so... >Subject: RE: [Apc-aa-coders] getDB and freeDB > >Jakub > >The issue is NOT about creating and destroying variables. > >What we are trying to achieve is to make sure database connections are cached. > >if you use local variables - e.g. $db = new DB_AA - then I believe >the variable will be destroyed and the database connection dropped >at the end of the function. > >If you use global variables - i.e. global $db - then you share the >database connection, but there is a significant risk that an inner >function will try and use a database connection still being used at >the outer level. > >getDB and freeDB use a database pool, look at the definitions in >util.php3 to see how, a function grabs a free DB_AA and then >releases it when finished. That way only the minimum needed number >of DB_AA (and Database connections) get created. > >I'm making assumptions about how PHP manages its database >connections, which is why I'm asking this question, in case either >of you have more information. > >- Mitra > > >At 11:35 AM +0100 3/3/03, Jakub Adamek wrote: > >>I am not sure when PHP frees variables, perhaps on leaving a >>function, surely not later than on finishing the script. This way >>it knows you finished your SELECT. My suggestion is not to use >>"global $db" but "$db = new DB_AA" which should be sufficient. >>Perhaps you could measure how much time (if any) it takes to create >>a new DB_AA. >> > > >Jakub > >-----Original Message----- >From: apc...@li... >[mailto:apc...@li...] On Behalf Of Mitra >Sent: Tuesday, February 25, 2003 4:56 AM >To: Jakub Adamek; apc...@so... >Subject: RE: [Apc-aa-coders] getDB and freeDB > >Jakub, Honza > > >Are we happy with the way I'm suggesting to do this ? > > >- Mitra > > > >At 9:03 AM +1100 18/2/03, Mitra wrote: > >>You could be correct, I'm not sure if PHP caches connections. >> > >What I KNOW to be bad is using $db, $db2, and $db3 because if in the >middle of using $db to fetch records, then you use a function call >(for example to turn and id into a name) and this uses the same $db >then you break things. Its a recipe for bugs. > > >So I see two solutiosn > > >1: $db = new DB_AA() ; use the $db ; > >or > >2: $db = getDB; use the $db ; freeDB($db) > > >Actually, I can't see how #1 (or the current way of doing things) >can reuse database connections, because how does PHP know when >you've finished with the SELECT? > > >yes - there could be a problem with "return" without freeing the db, >but I'd rather have an occasional inefficiency, than a big problem >with possible bugs. I'm not making any mass changes, just changing >the code as I work on it, so I think it will be easy to do it >carefully. > > >- Mitra > > > >At 8:56 PM +0100 17/2/03, Jakub Adamek wrote: > >>Mitra, >> >>the PHPlib approach of having the DB connection and recordset in one >>class is a bit strange. The result is, we should create a new recordset >>DB_AA for each SELECT query. The current approach of using one recordset >>everywhere is perhaps caused by the name DB_AA which looks like database >>and usually only one database is used. It is surely wrong. >> >>I am not sure, but my idea was that the persistent connections are kept >>by PHP and not by individual scripts and thus creating a new DB_AA would >>waste no time as it uses always only finds a persisten connection? It >>this is the case, getDB and freeDB are not needed because they only >>duplicate this behavior. >> >>One more remark: Your approach seems to me a bit uncovenient. The >>problem is you must call freeDB() every time you exit any function. >>Surely somebody will forget to do so at least in some places where he or >> >she uses "return". In C++ such things are solved by constructors and > >destructors, but PHP has no destructors. On the other hand this will > >perhaps do no much damage as the not-freed DBs will be closed as the >script finishes. > >Jakub > >> -----Original Message----- >> From: apc...@li... >> [mailto:apc...@li...] On Behalf Of Mitra > > > Sent: Sunday, February 16, 2003 10:56 AM >> To: apc...@so... >> Subject: [Apc-aa-coders] getDB and freeDB >> >> >> One change of note is to add functions getDB and freeDB so that there >> is no longer the risk of one operation mucking up an in-process DB >> action. >> >> Basically instead of trying to decide whether to use globals $db $db2 >> or $db3 instead just go >> >> >> $db = getDB() >> $db->normal db ops >> freeDB($db) >> >> The system keeps an array of unused $db's so that we still get the >> advantages of keeping connections open. >> >> I have NOT incorporated this into the existing code, - since to do so > > > would inevitably involve making one or more mistakes that broke > > > something!, but I will do whenever I'm working on something. > > > > > > - 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 >> >> >> >> ------------------------------------------------------- >> This sf.net email is sponsored by:ThinkGeek >> Welcome to geek heaven. >> http://thinkgeek.com/sf >> _______________________________________________ >> Apc-aa-coders mailing list >> Apc...@li... > > > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > > > > > >-- > >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-04 20:51:04
|
Any thoughts on this? How would we like to pass error results back from one of the insert_fnc_xxx functions? - Mitra At 9:57 AM +1100 26/2/03, Mitra wrote: >Don't we need to define ONE of these ways, and then convert the >existing functions to use it, I think the confusion is because the >rules aren't defined so each coder has done it differently. > >For example insert_fnc_fil sets $err, but that is ignored. > >I would suggest that we need both errors and warnings, i.e. that a >warning is set when an item *IS*created/edited, and errors are set >when an item *IS NOT* created/edited. > >- Mitra > > >At 2:03 PM +0100 25/2/03, Honza Malik wrote: >>Hi Mitra, >> >> you are right, currently generated messages from insert_fnc_xxx >>functions are ignored - we do not use the return code. So, it is up to >>you, how to display the errors to user (direct displaying in >>StoreItem(), filling global $err[] array, creating new Error object, >>...). I do not prefer option 1. >> >>Regards, >> Honza >> >>On P=E1, 2003-02-21 at 22:51, Mitra wrote: >>> Honza >>> >>> How are errors SUPPOSED to be returned from insert_fnc_xxxx functions, >>> >>> I see various places where things are done like return "xxxx" >>> >>> But ...the calling functions seem to ignore these errors, >>> >>> Specifically I'm trying to get errors generated inside insert_fnc_fil >>> when trying and failing to do a Resize to propogate all the way back >>> to the calling Item Manager screen, and I can't figure out how you >>> wanted this to work. >>> >>> - 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 >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. >>> The most comprehensive and flexible code editor you can use. >>> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. >>> www.slickedit.com/sourceforge >>> _______________________________________________ >>> Apc-aa-coders mailing list >>> Apc...@li... >>> https://lists.sourceforge.net/lists/listinfo/apc-aa-coders >>> >> >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf >>_______________________________________________ >>Apc-aa-coders mailing list >>Apc...@li... >>https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > >-- >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-04 20:50:54
|
Any more thoughts on this? I've fixed it on my copy by setting register_globals on, but many people installing APC-AA won't have access to php.ini - Mitra At 9:54 AM +1100 26/2/03, Mitra wrote: >Maybe it is not so much work .... > >We have code that is all over the place > > >if (!get_magic_quotes_gpc()) { > // Overrides GPC variables > if( isset($HTTP_GET_VARS) AND is_array($HTTP_GET_VARS)) > for (reset($HTTP_GET_VARS); list($k, $v) =3D each($HTTP_GET_VARS); ) > $$k =3D Myaddslashes($v); > if( isset($HTTP_POST_VARS) AND is_array($HTTP_POST_VARS)) > for (reset($HTTP_POST_VARS); list($k, $v) =3D each($HTTP_POST_VARS); ) > $$k =3D Myaddslashes($v); > if( isset($HTTP_COOKIE_VARS) AND is_array($HTTP_COOKIE_VARS)) > for (reset($HTTP_COOKIE_VARS); list($k, $v) =3D each($HTTP_COOKIE_VARS= ); ) > $$k =3D Myaddslashes($v); >} > >We could change MyAddSlashes to set the GLOBALS, variables if >register_globals was off? > >Anyway - shouldn't this be an include, since we do it the same way >almost everywhere? I can see that include/config.php3 is called >after this but I can't see anything in config.php3 that depends on >these variable, so we could just call a script, say >$GLOBALS[AA_INC_PATH]/setvariables.php3 AFTER config.php. > >I think the code would also need to handle a few extra variables >like $DOCUMENT_ROOT becoming $_SERVER['DOCUMENT_ROOT'] > >This could be easily done with a Tags-find-replace since we aren't >changing functionality, only variable names. The hard part is that >we need to work in the pre 4.2.0 case as well, so it might be best >to do it all in include/setvariables.php3 e.g. > >if somecall(register_globals) { /// Not sure how to test this > $DOCUMENT_ROOT =3D $_SERVER['DOCUMENT_ROOT'] >} > >Thoughts .... > > >- Mitra > > >At 1:29 PM +0100 25/2/03, Honza Malik wrote: >>Hi Mitra, >> >> I think you upgraded PHP to version >=3D4.2.0, where PHP configuration >>directive register_globals is set to OFF by default. Current AA runs >>only with the register_globals set to ON. We should change the code of >>AA to use superglobals variables $_GET, $_POST, $_COOKIE, ..., but is >>uis quite a lot of work. On the other hand, the new settings of PHP >>(register_globals=3DOFF) is safer, so we should do it. >> >> See >> >>http://www.php.net/manual/en/language.variables.predefined.php#language.va= riables.superglobals >> >> Honza >> >>On P=E1, 2003-02-21 at 14:02, Mitra wrote: >>> Hi >>> >>> Something seems to have changed on my home system, so that global >>> variables aren't getting set. I don't think its an APC change >>> because a backup version stopped working as well. I have upgraded >>> the OS (Mac OSX) recently so its possible that a config file >>> changed, so I'm really looking for help to find out what changed. >>> >>> There is NO php.ini in use. >>> >>> I've look on include/init_page and get_magic_quotes_gpc() is returning = 1 >>> so the piece of code that sets the variables isn't being run. >>> >>> If that code is NOT run, then how are the variables set from the URL >> > i.e. from HTTP_GET_VARS? >> > >> > - 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 >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. >>> The most comprehensive and flexible code editor you can use. >>> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. >>> www.slickedit.com/sourceforge >>> _______________________________________________ >>> Apc-aa-coders mailing list >>> Apc...@li... >>> https://lists.sourceforge.net/lists/listinfo/apc-aa-coders >> > >> >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf >>_______________________________________________ >>Apc-aa-coders mailing list >>Apc...@li... >>https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > >-- >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: Honza M. <hon...@ec...> - 2003-03-04 18:22:18
|
My CVS changes for today: 03/04/03 - new parameters "columns" and "move_right" for Radio Button input type, which allows you to put radiobuttons in the grid (just like for Multiple Checkboxes) - fixed problem with language files in links module Honza |
From: Jakub A. <jak...@se...> - 2003-03-04 12:34:06
|
Mitra, I understand you fully. But my idea is you don't need to create a database pool if it takes no time and resources to create a new connection. Just delete or "global $db" and each function creates its own connection (or reuses a persistent one). But it would be necessary to measure whether this approach will or won't take too much time or memory. Jakub -----Original Message----- From: apc...@li... [mailto:apc...@li...] On Behalf Of Mitra Sent: Monday, March 03, 2003 11:16 PM To: Jakub Adamek; apc...@so... Subject: RE: [Apc-aa-coders] getDB and freeDB Jakub The issue is NOT about creating and destroying variables. What we are trying to achieve is to make sure database connections are cached. if you use local variables - e.g. $db = new DB_AA - then I believe the variable will be destroyed and the database connection dropped at the end of the function. If you use global variables - i.e. global $db - then you share the database connection, but there is a significant risk that an inner function will try and use a database connection still being used at the outer level. getDB and freeDB use a database pool, look at the definitions in util.php3 to see how, a function grabs a free DB_AA and then releases it when finished. That way only the minimum needed number of DB_AA (and Database connections) get created. I'm making assumptions about how PHP manages its database connections, which is why I'm asking this question, in case either of you have more information. - Mitra At 11:35 AM +0100 3/3/03, Jakub Adamek wrote: I am not sure when PHP frees variables, perhaps on leaving a function, surely not later than on finishing the script. This way it knows you finished your SELECT. My suggestion is not to use "global $db" but "$db = new DB_AA" which should be sufficient. Perhaps you could measure how much time (if any) it takes to create a new DB_AA. Jakub -----Original Message----- From: apc...@li... [mailto:apc...@li...] On Behalf Of Mitra Sent: Tuesday, February 25, 2003 4:56 AM To: Jakub Adamek; apc...@so... Subject: RE: [Apc-aa-coders] getDB and freeDB Jakub, Honza Are we happy with the way I'm suggesting to do this ? - Mitra At 9:03 AM +1100 18/2/03, Mitra wrote: You could be correct, I'm not sure if PHP caches connections. What I KNOW to be bad is using $db, $db2, and $db3 because if in the middle of using $db to fetch records, then you use a function call (for example to turn and id into a name) and this uses the same $db then you break things. Its a recipe for bugs. So I see two solutiosn 1: $db = new DB_AA() ; use the $db ; or 2: $db = getDB; use the $db ; freeDB($db) Actually, I can't see how #1 (or the current way of doing things) can reuse database connections, because how does PHP know when you've finished with the SELECT? yes - there could be a problem with "return" without freeing the db, but I'd rather have an occasional inefficiency, than a big problem with possible bugs. I'm not making any mass changes, just changing the code as I work on it, so I think it will be easy to do it carefully. - Mitra At 8:56 PM +0100 17/2/03, Jakub Adamek wrote: Mitra, the PHPlib approach of having the DB connection and recordset in one class is a bit strange. The result is, we should create a new recordset DB_AA for each SELECT query. The current approach of using one recordset everywhere is perhaps caused by the name DB_AA which looks like database and usually only one database is used. It is surely wrong. I am not sure, but my idea was that the persistent connections are kept by PHP and not by individual scripts and thus creating a new DB_AA would waste no time as it uses always only finds a persisten connection? It this is the case, getDB and freeDB are not needed because they only duplicate this behavior. One more remark: Your approach seems to me a bit uncovenient. The problem is you must call freeDB() every time you exit any function. Surely somebody will forget to do so at least in some places where he or she uses "return". In C++ such things are solved by constructors and destructors, but PHP has no destructors. On the other hand this will perhaps do no much damage as the not-freed DBs will be closed as the script finishes. Jakub > -----Original Message----- > From: apc...@li... > [mailto:apc...@li...] On Behalf Of Mitra > Sent: Sunday, February 16, 2003 10:56 AM > To: apc...@so... > Subject: [Apc-aa-coders] getDB and freeDB > > > One change of note is to add functions getDB and freeDB so that there > is no longer the risk of one operation mucking up an in-process DB > action. > > Basically instead of trying to decide whether to use globals $db $db2 > or $db3 instead just go > > > $db = getDB() > $db->normal db ops > freeDB($db) > > The system keeps an array of unused $db's so that we still get the > advantages of keeping connections open. > > I have NOT incorporated this into the existing code, - since to do so > would inevitably involve making one or more mistakes that broke > something!, but I will do whenever I'm working on something. > > - 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 > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > -- 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-04 03:48:26
|
I've fixed a problem with caching which meant that when you have nested views from different slices - for example where a field in one slice refers to some content in another slice, then the caching didn't invalidate properly. To do this, I've introduced $GLOBALS[str2find_passon] which passes back up a nested hierarchy a record of slices that have been used. I might not catch all the possible places where this happens - I only found get_output_cached and GetView, but at least it will do a better job than now! The fix is in CVS (Honza - this is separate from the problem I discussed with you, or purge getting called too often) - 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-03 22:28:44
|
I don't remember any description of post2shtml and don't find anything in the apc-aa.sourceforge.net/faq So how is the .shtml page supposed to access these variables? - Mitra At 11:35 AM +0100 3/3/03, Jakub Adamek wrote: >Hi all, > >I see Honza already answered this, but my answer adds some details so I >am sending it as well. > >I hope I already described the lovely feature post2shtml: There is no >way to POST to a .shtml page, you must always use the GET method, which >has several disadvantages. Thus I created a PHP script post2shtml.php3, >the variables are sent to it and stored to database. Than you are >redirected to the .shtml page and PHP scripts called through SSI >includes retrieve againt the variables from the database. > >The table post2shtml is a part of sql_update.php3, just create it. > >Jakub > >> -----Original Message----- >> From: apc...@li... >> [mailto:apc...@li...] On Behalf Of Mitra >> Sent: Wednesday, February 26, 2003 10:25 PM >> To: apc...@so... >> Cc: ra...@pa... >> Subject: [Apc-aa-coders] Re: anonymous form filling >> >> >> Ram - the main problem seems to me that the table this is being sent >> to - post2shtml - doesn't exist. >> >> I don't understand how this works, or where you set the table for it >> to go to ...... I thought anonymously posted items got added as >> regular items in some slice or other. >> >> - Mitra >> >> >> At 12:59 AM +0530 27/2/03, Ram Prasad wrote: >> >Mitra >> > >> >I was trying out the anonymous form filling wizard for my >> Taskss Slice. >> >The form got created fine. I clicked on send, without providing any >> >values (a blank form) and got the following dump on the >> screen: (should >> >it have not just complained about the values not being there ?) >> > >> >Database error: Invalid SQL: INSERT INTO post2shtml (id, vars, time) >> >VALUES ('b24442e11fdfa9dc45c04fca69e844a1', >> >'a:4:{s:4:\"post\";a:25:{s:7:\"err_url\";s:31:\"http://FILL_Y >OUR_PAGE_U >> >RL.sh tml\";s:6:\"ok_url\";s:31:\"http://FILL_YOUR_PAGE_URL.shtml\" >> ;s:8:\"slice_id > > >\";s:32:\"cd5409ecfbeba5303da25590203d7d03\";s:14:\"use_post2 > > shtml\";s:1:\"1 > > >\";s:10:\"my_item_id\";s:0:\"\";s:45:\"edtv686561646c696e652e > > 2e2e2e2e2e2e2e_ > > >FontName\";s:1:\"0\";s:45:\"edtv686561646c696e652e2e2e2e2e2e2 >> e2e_FontSize\"; >> >s:1:\"0\";s:33:\"v686561646c696e652e2e2e2e2e2e2e2e\";s:0:\"\" >> ;s:37:\"v686561 >> >646c696e652e2e2e2e2e2e2e2ehtml\";s:1:\"h\";s:33:\"v6162737472 >> 6163742e2e2e2e2 >> >e2e2e31\";s:4:\"Mark\";s:45:\"edtv66756c6c5f746578742e2e2e2e2 >> e2e2e_FontName\ >> >";s:1:\"0\";s:45:\"edtv66756c6c5f746578742e2e2e2e2e2e2e_FontS >> ize\";s:1:\"0\" >> >;s:33:\"v66756c6c5f746578742e2e2e2e2e2e2e\";s:0:\"\";s:37:\"v >> 66756c6c5f74657 >> >8742e2e2e2e2e2e2ehtml\";s:1:\"h\";s:33:\"v63617465676f72792e2 >> e2e2e2e2e2e2e\" >> >;s:11:\"In_Progress\";s:33:\"v746578742e2e2e2e2e2e2e2e2e2e2e3 >> 2\";s:0:\"\";s: >> >33:\"v746578742e2e2e2e2e2e2e2e2e2e2e31\";s:0:\"\";s:33:\"v656 >> e645f646174652e >> >2e2e2e2e2e2e31\";s:0:\"\";s:45:\"edtv61627374726163742e2e2e2e >> 2e2e2e32_FontNa >> >me\";s:1:\"0\";s:45:\"edtv61627374726163742e2e2e2e2e2e2e32_Fo >> ntSize\";s:1:\" >> >0\";s:33:\"v61627374726163742e2e2e2e2e2e2e32\";s:0:\"\";s:37: >> \"v616273747261 >> >63742e2e2e2e2e2e2e32html\";s:1:\"h\";s:4:\"send\";s:4:\"Send\ >> ";s:6:\"result\ >> >";a:1:{s:8:\"validate\";a:2:{s:33:\"v686561646c696e652e2e2e2e >> 2e2e2e2e\";s:54 >> >:\" >> >Error in Task (it must be filled) >> >\";s:33:\"v746578742e2e2e2e2e2e2e2e2e2e2e32\";s:63:\" >> >Error in Received Date (it must be filled) >> >\";}}s:13:\"oldcontent4id\";a:34:{s:16:\"headline........\";a >> :1:{i:0;a:2:{s: >> >5:\"value\";s:0:\"\";s:4:\"flag\";i:1;}}s:16:\"abstract...... >> .1\";a:1:{i:0;a >> >:2:{s:5:\"value\";s:4:\"Mark\";s:4:\"flag\";i:0;}}s:16:\"full >_text.......\"; >> >a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:1;}}s:16: >> \"category..... >> >...\";a:1:{i:0;a:2:{s:5:\"value\";s:11:\"In_Progress\";s:4:\" >flag\";i:0;}}s: >> >16:\"text...........2\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\"; >> s:4:\"flag\";i: >> >0;}}s:16:\"text...........1\";a:1:{i:0;a:2:{s:5:\"value\";s:0 >> :\"\";s:4:\"fla >> >g\";i:0;}}s:16:\"end_date.......1\";a:1:{i:0;a:2:{s:5:\"value >> \";s:0:\"\";s:4 >> >:\"flag\";i:0;}}s:16:\"abstract.......2\";a:1:{i:0;a:2:{s:5:\ >> "value\";s:0:\" >> >\";s:4:\"flag\";i:1;}}s:16:\"highlight.......\";a:1:{i:0;a:2: >> {s:5:\"value\"; >> >i:0;s:4:\"flag\";i:0;}}s:16:\"link_only.......\";a:1:{i:0;a:2 >> :{s:5:\"value\" >> >;s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"hl_href.........\";a:1:{i >> :0;a:2:{s:5:\"v >> >alue\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"created_by......\"; >> a:1:{i:0;a:2:{s >> >:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"e_posted_by.. >> ...\";a:1:{i:0; >> >a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"source. >.........\";a:1 >> >:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"s >ource_href..... >> >\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s: >> 16:\"place..... >> >......\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i: >> 0;}}s:16:\"expi >> >ry_date.....\";a:1:{i:0;a:2:{s:5:\"value\";i:1219042800;s:4:\ >"flag\";i:0;}}s >> >:16:\"publish_date....\";a:1:{i:0;a:2:{s:5:\"value\";i:104628 >7486;s:4:\"flag >> >\";i:0;}}s:16:\"lang_code.......\";a:1:{i:0;a:2:{s:5:\"value\ >";s:2:\"EN\";s: >> >4:\"flag\";i:0;}}s:16:\"cp_code.........\";a:1:{i:0;a:2:{s:5: >> \"value\";s:9:\ >> >"iso8859-1\";s:4:\"flag\";i:0;}}s:16:\"img_src.........\";a:1 >> :{i:0;a:2:{s:5: >> >\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"img_width....... >> \";a:1:{i:0;a:2 >> >:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"img_height >> ......\";a:1:{i >> >:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"edit >_note.......\"; >> >a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16: >> \"slice_id..... >> >...\";a:1:{i:0;a:2:{s:5:\"value\";s:1:\"1\";s:4:\"flag\";i:0; >> }}s:16:\"post_d >> >ate.......\";a:1:{i:0;a:2:{s:5:\"value\";i:1046287486;s:4:\"f >> lag\";i:0;}}s:1 >> >6:\"status_code.....\";a:1:{i:0;a:2:{s:5:\"value\";s:1:\"1\"; >> s:4:\"flag\";i: >> >0;}}s:16:\"edited_by.......\";a:1:{i:0;a:2:{s:5:\"value\";s:0 >> :\"\";s:4:\"fla >> >g\";i:0;}}s:16:\"posted_by.......\";a:1:{i:0;a:2:{s:5:\"value >> \";s:0:\"\";s:4 >> >:\"flag\";i:0;}}s:16:\"last_edit.......\";a:1:{i:0;a:2:{s:5:\ >> "value\";i:1046 >> >287486;s:4:\"flag\";i:0;}}s:16:\"display_count...\";a:1:{i:0; >a:2:{s:5:\"valu >> >e\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"disc_count......\";a: >> 1:{i:0;a:2:{s:5 >> >:\"value\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"disc_app...... >> ..\";a:1:{i:0;a >> >:2:{s:5:\"value\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"flags.. >.........\";a:1 >> >:{i:0;a:1:{s:5:\"value\";i:32;}}}}s:3:\"get\";a:0:{}s:5:\"fil >> es\";a:0:{}s:6: >> >\"cookie\";a:0:{}}', 1046287486) >> >MySQL Error: 1146 (Table 'aadb.post2shtml' doesn't exist) Please >> >contact mi...@ea... and report the exact >> error message. >> >Session halted. >> >> >> -- >> 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 >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: Scholarships for Techies! >> Can't afford IT training? All 2003 ictp students receive >> scholarships. Get hands-on training in Microsoft, Cisco, Sun, >> Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp >> _______________________________________________ >> Apc-aa-coders mailing list >> Apc...@li... >> https://lists.sourceforge.net/lists/listinfo/apc-aa-coders >> > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Apc-aa-coders mailing list >Apc...@li... >https://lists.sourceforge.net/lists/listinfo/apc-aa-coders -- 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-03 22:18:22
|
Jakub The issue is NOT about creating and destroying variables. What we are trying to achieve is to make sure database connections are cached. if you use local variables - e.g. $db = new DB_AA - then I believe the variable will be destroyed and the database connection dropped at the end of the function. If you use global variables - i.e. global $db - then you share the database connection, but there is a significant risk that an inner function will try and use a database connection still being used at the outer level. getDB and freeDB use a database pool, look at the definitions in util.php3 to see how, a function grabs a free DB_AA and then releases it when finished. That way only the minimum needed number of DB_AA (and Database connections) get created. I'm making assumptions about how PHP manages its database connections, which is why I'm asking this question, in case either of you have more information. - Mitra At 11:35 AM +0100 3/3/03, Jakub Adamek wrote: >I am not sure when PHP frees variables, perhaps on leaving a >function, surely not later than on finishing the script. This way it >knows you finished your SELECT. My suggestion is not to use "global >$db" but "$db = new DB_AA" which should be sufficient. Perhaps you >could measure how much time (if any) it takes to create a new DB_AA. > >Jakub > >-----Original Message----- >From: apc...@li... >[mailto:apc...@li...] On Behalf Of Mitra >Sent: Tuesday, February 25, 2003 4:56 AM >To: Jakub Adamek; apc...@so... >Subject: RE: [Apc-aa-coders] getDB and freeDB > >Jakub, Honza > >Are we happy with the way I'm suggesting to do this ? > >- Mitra > > >At 9:03 AM +1100 18/2/03, Mitra wrote: > >>You could be correct, I'm not sure if PHP caches connections. >> > >What I KNOW to be bad is using $db, $db2, and $db3 because if in the >middle of using $db to fetch records, then you use a function call >(for example to turn and id into a name) and this uses the same $db >then you break things. Its a recipe for bugs. > > >So I see two solutiosn > > >1: $db = new DB_AA() ; use the $db ; > >or > >2: $db = getDB; use the $db ; freeDB($db) > > >Actually, I can't see how #1 (or the current way of doing things) >can reuse database connections, because how does PHP know when >you've finished with the SELECT? > > >yes - there could be a problem with "return" without freeing the db, >but I'd rather have an occasional inefficiency, than a big problem >with possible bugs. I'm not making any mass changes, just changing >the code as I work on it, so I think it will be easy to do it >carefully. > > >- Mitra > > > >At 8:56 PM +0100 17/2/03, Jakub Adamek wrote: > >>Mitra, >> >>the PHPlib approach of having the DB connection and recordset in one >>class is a bit strange. The result is, we should create a new recordset >>DB_AA for each SELECT query. The current approach of using one recordset >>everywhere is perhaps caused by the name DB_AA which looks like database >>and usually only one database is used. It is surely wrong. >> >>I am not sure, but my idea was that the persistent connections are kept >>by PHP and not by individual scripts and thus creating a new DB_AA would >>waste no time as it uses always only finds a persisten connection? It >>this is the case, getDB and freeDB are not needed because they only >>duplicate this behavior. >> >>One more remark: Your approach seems to me a bit uncovenient. The >>problem is you must call freeDB() every time you exit any function. >>Surely somebody will forget to do so at least in some places where he or >she uses "return". In C++ such things are solved by constructors and >destructors, but PHP has no destructors. On the other hand this will >perhaps do no much damage as the not-freed DBs will be closed as the >script finishes. > >Jakub > >> -----Original Message----- >> From: apc...@li... >> [mailto:apc...@li...] On Behalf Of Mitra > > Sent: Sunday, February 16, 2003 10:56 AM >> To: apc...@so... >> Subject: [Apc-aa-coders] getDB and freeDB >> >> >> One change of note is to add functions getDB and freeDB so that there >> is no longer the risk of one operation mucking up an in-process DB >> action. >> >> Basically instead of trying to decide whether to use globals $db $db2 >> or $db3 instead just go >> >> >> $db = getDB() >> $db->normal db ops >> freeDB($db) >> >> The system keeps an array of unused $db's so that we still get the >> advantages of keeping connections open. >> >> I have NOT incorporated this into the existing code, - since to do so > > > would inevitably involve making one or more mistakes that broke > > > something!, but I will do whenever I'm working on something. > > > > > > - 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 >> >> >> >> ------------------------------------------------------- >> This sf.net email is sponsored by:ThinkGeek >> Welcome to geek heaven. >> http://thinkgeek.com/sf >> _______________________________________________ >> Apc-aa-coders mailing list >> Apc...@li... > > > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > > > > > >-- > >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-03 10:35:58
|
I am not sure when PHP frees variables, perhaps on leaving a function, surely not later than on finishing the script. This way it knows you finished your SELECT. My suggestion is not to use "global $db" but "$db = new DB_AA" which should be sufficient. Perhaps you could measure how much time (if any) it takes to create a new DB_AA. Jakub -----Original Message----- From: apc...@li... [mailto:apc...@li...] On Behalf Of Mitra Sent: Tuesday, February 25, 2003 4:56 AM To: Jakub Adamek; apc...@so... Subject: RE: [Apc-aa-coders] getDB and freeDB Jakub, Honza Are we happy with the way I'm suggesting to do this ? - Mitra At 9:03 AM +1100 18/2/03, Mitra wrote: You could be correct, I'm not sure if PHP caches connections. What I KNOW to be bad is using $db, $db2, and $db3 because if in the middle of using $db to fetch records, then you use a function call (for example to turn and id into a name) and this uses the same $db then you break things. Its a recipe for bugs. So I see two solutiosn 1: $db = new DB_AA() ; use the $db ; or 2: $db = getDB; use the $db ; freeDB($db) Actually, I can't see how #1 (or the current way of doing things) can reuse database connections, because how does PHP know when you've finished with the SELECT? yes - there could be a problem with "return" without freeing the db, but I'd rather have an occasional inefficiency, than a big problem with possible bugs. I'm not making any mass changes, just changing the code as I work on it, so I think it will be easy to do it carefully. - Mitra At 8:56 PM +0100 17/2/03, Jakub Adamek wrote: Mitra, the PHPlib approach of having the DB connection and recordset in one class is a bit strange. The result is, we should create a new recordset DB_AA for each SELECT query. The current approach of using one recordset everywhere is perhaps caused by the name DB_AA which looks like database and usually only one database is used. It is surely wrong. I am not sure, but my idea was that the persistent connections are kept by PHP and not by individual scripts and thus creating a new DB_AA would waste no time as it uses always only finds a persisten connection? It this is the case, getDB and freeDB are not needed because they only duplicate this behavior. One more remark: Your approach seems to me a bit uncovenient. The problem is you must call freeDB() every time you exit any function. Surely somebody will forget to do so at least in some places where he or she uses "return". In C++ such things are solved by constructors and destructors, but PHP has no destructors. On the other hand this will perhaps do no much damage as the not-freed DBs will be closed as the script finishes. Jakub > -----Original Message----- > From: apc...@li... > [mailto:apc...@li...] On Behalf Of Mitra > Sent: Sunday, February 16, 2003 10:56 AM > To: apc...@so... > Subject: [Apc-aa-coders] getDB and freeDB > > > One change of note is to add functions getDB and freeDB so that there > is no longer the risk of one operation mucking up an in-process DB > action. > > Basically instead of trying to decide whether to use globals $db $db2 > or $db3 instead just go > > > $db = getDB() > $db->normal db ops > freeDB($db) > > The system keeps an array of unused $db's so that we still get the > advantages of keeping connections open. > > I have NOT incorporated this into the existing code, - since to do so > would inevitably involve making one or more mistakes that broke > something!, but I will do whenever I'm working on something. > > - 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 > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > -- 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-03 10:35:55
|
Hi all, I see Honza already answered this, but my answer adds some details so I am sending it as well. I hope I already described the lovely feature post2shtml: There is no way to POST to a .shtml page, you must always use the GET method, which has several disadvantages. Thus I created a PHP script post2shtml.php3, the variables are sent to it and stored to database. Than you are redirected to the .shtml page and PHP scripts called through SSI includes retrieve againt the variables from the database. The table post2shtml is a part of sql_update.php3, just create it. Jakub > -----Original Message----- > From: apc...@li... > [mailto:apc...@li...] On Behalf Of Mitra > Sent: Wednesday, February 26, 2003 10:25 PM > To: apc...@so... > Cc: ra...@pa... > Subject: [Apc-aa-coders] Re: anonymous form filling > > > Ram - the main problem seems to me that the table this is being sent > to - post2shtml - doesn't exist. > > I don't understand how this works, or where you set the table for it > to go to ...... I thought anonymously posted items got added as > regular items in some slice or other. > > - Mitra > > > At 12:59 AM +0530 27/2/03, Ram Prasad wrote: > >Mitra > > > >I was trying out the anonymous form filling wizard for my > Taskss Slice. > >The form got created fine. I clicked on send, without providing any > >values (a blank form) and got the following dump on the > screen: (should > >it have not just complained about the values not being there ?) > > > >Database error: Invalid SQL: INSERT INTO post2shtml (id, vars, time) > >VALUES ('b24442e11fdfa9dc45c04fca69e844a1', > >'a:4:{s:4:\"post\";a:25:{s:7:\"err_url\";s:31:\"http://FILL_Y OUR_PAGE_U > >RL.sh tml\";s:6:\"ok_url\";s:31:\"http://FILL_YOUR_PAGE_URL.shtml\" > ;s:8:\"slice_id > >\";s:32:\"cd5409ecfbeba5303da25590203d7d03\";s:14:\"use_post2 > shtml\";s:1:\"1 > >\";s:10:\"my_item_id\";s:0:\"\";s:45:\"edtv686561646c696e652e > 2e2e2e2e2e2e2e_ > >FontName\";s:1:\"0\";s:45:\"edtv686561646c696e652e2e2e2e2e2e2 > e2e_FontSize\"; > >s:1:\"0\";s:33:\"v686561646c696e652e2e2e2e2e2e2e2e\";s:0:\"\" > ;s:37:\"v686561 > >646c696e652e2e2e2e2e2e2e2ehtml\";s:1:\"h\";s:33:\"v6162737472 > 6163742e2e2e2e2 > >e2e2e31\";s:4:\"Mark\";s:45:\"edtv66756c6c5f746578742e2e2e2e2 > e2e2e_FontName\ > >";s:1:\"0\";s:45:\"edtv66756c6c5f746578742e2e2e2e2e2e2e_FontS > ize\";s:1:\"0\" > >;s:33:\"v66756c6c5f746578742e2e2e2e2e2e2e\";s:0:\"\";s:37:\"v > 66756c6c5f74657 > >8742e2e2e2e2e2e2ehtml\";s:1:\"h\";s:33:\"v63617465676f72792e2 > e2e2e2e2e2e2e\" > >;s:11:\"In_Progress\";s:33:\"v746578742e2e2e2e2e2e2e2e2e2e2e3 > 2\";s:0:\"\";s: > >33:\"v746578742e2e2e2e2e2e2e2e2e2e2e31\";s:0:\"\";s:33:\"v656 > e645f646174652e > >2e2e2e2e2e2e31\";s:0:\"\";s:45:\"edtv61627374726163742e2e2e2e > 2e2e2e32_FontNa > >me\";s:1:\"0\";s:45:\"edtv61627374726163742e2e2e2e2e2e2e32_Fo > ntSize\";s:1:\" > >0\";s:33:\"v61627374726163742e2e2e2e2e2e2e32\";s:0:\"\";s:37: > \"v616273747261 > >63742e2e2e2e2e2e2e32html\";s:1:\"h\";s:4:\"send\";s:4:\"Send\ > ";s:6:\"result\ > >";a:1:{s:8:\"validate\";a:2:{s:33:\"v686561646c696e652e2e2e2e > 2e2e2e2e\";s:54 > >:\" > >Error in Task (it must be filled) > >\";s:33:\"v746578742e2e2e2e2e2e2e2e2e2e2e32\";s:63:\" > >Error in Received Date (it must be filled) > >\";}}s:13:\"oldcontent4id\";a:34:{s:16:\"headline........\";a > :1:{i:0;a:2:{s: > >5:\"value\";s:0:\"\";s:4:\"flag\";i:1;}}s:16:\"abstract...... > .1\";a:1:{i:0;a > >:2:{s:5:\"value\";s:4:\"Mark\";s:4:\"flag\";i:0;}}s:16:\"full _text.......\"; > >a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:1;}}s:16: > \"category..... > >...\";a:1:{i:0;a:2:{s:5:\"value\";s:11:\"In_Progress\";s:4:\" flag\";i:0;}}s: > >16:\"text...........2\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\"; > s:4:\"flag\";i: > >0;}}s:16:\"text...........1\";a:1:{i:0;a:2:{s:5:\"value\";s:0 > :\"\";s:4:\"fla > >g\";i:0;}}s:16:\"end_date.......1\";a:1:{i:0;a:2:{s:5:\"value > \";s:0:\"\";s:4 > >:\"flag\";i:0;}}s:16:\"abstract.......2\";a:1:{i:0;a:2:{s:5:\ > "value\";s:0:\" > >\";s:4:\"flag\";i:1;}}s:16:\"highlight.......\";a:1:{i:0;a:2: > {s:5:\"value\"; > >i:0;s:4:\"flag\";i:0;}}s:16:\"link_only.......\";a:1:{i:0;a:2 > :{s:5:\"value\" > >;s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"hl_href.........\";a:1:{i > :0;a:2:{s:5:\"v > >alue\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"created_by......\"; > a:1:{i:0;a:2:{s > >:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"e_posted_by.. > ...\";a:1:{i:0; > >a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"source. .........\";a:1 > >:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"s ource_href..... > >\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s: > 16:\"place..... > >......\";a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i: > 0;}}s:16:\"expi > >ry_date.....\";a:1:{i:0;a:2:{s:5:\"value\";i:1219042800;s:4:\ "flag\";i:0;}}s > >:16:\"publish_date....\";a:1:{i:0;a:2:{s:5:\"value\";i:104628 7486;s:4:\"flag > >\";i:0;}}s:16:\"lang_code.......\";a:1:{i:0;a:2:{s:5:\"value\ ";s:2:\"EN\";s: > >4:\"flag\";i:0;}}s:16:\"cp_code.........\";a:1:{i:0;a:2:{s:5: > \"value\";s:9:\ > >"iso8859-1\";s:4:\"flag\";i:0;}}s:16:\"img_src.........\";a:1 > :{i:0;a:2:{s:5: > >\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"img_width....... > \";a:1:{i:0;a:2 > >:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"img_height > ......\";a:1:{i > >:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16:\"edit _note.......\"; > >a:1:{i:0;a:2:{s:5:\"value\";s:0:\"\";s:4:\"flag\";i:0;}}s:16: > \"slice_id..... > >...\";a:1:{i:0;a:2:{s:5:\"value\";s:1:\"1\";s:4:\"flag\";i:0; > }}s:16:\"post_d > >ate.......\";a:1:{i:0;a:2:{s:5:\"value\";i:1046287486;s:4:\"f > lag\";i:0;}}s:1 > >6:\"status_code.....\";a:1:{i:0;a:2:{s:5:\"value\";s:1:\"1\"; > s:4:\"flag\";i: > >0;}}s:16:\"edited_by.......\";a:1:{i:0;a:2:{s:5:\"value\";s:0 > :\"\";s:4:\"fla > >g\";i:0;}}s:16:\"posted_by.......\";a:1:{i:0;a:2:{s:5:\"value > \";s:0:\"\";s:4 > >:\"flag\";i:0;}}s:16:\"last_edit.......\";a:1:{i:0;a:2:{s:5:\ > "value\";i:1046 > >287486;s:4:\"flag\";i:0;}}s:16:\"display_count...\";a:1:{i:0; a:2:{s:5:\"valu > >e\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"disc_count......\";a: > 1:{i:0;a:2:{s:5 > >:\"value\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"disc_app...... > ..\";a:1:{i:0;a > >:2:{s:5:\"value\";s:1:\"0\";s:4:\"flag\";i:0;}}s:16:\"flags.. .........\";a:1 > >:{i:0;a:1:{s:5:\"value\";i:32;}}}}s:3:\"get\";a:0:{}s:5:\"fil > es\";a:0:{}s:6: > >\"cookie\";a:0:{}}', 1046287486) > >MySQL Error: 1146 (Table 'aadb.post2shtml' doesn't exist) Please > >contact mi...@ea... and report the exact > error message. > >Session halted. > > > -- > 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 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Scholarships for Techies! > Can't afford IT training? All 2003 ictp students receive > scholarships. Get hands-on training in Microsoft, Cisco, Sun, > Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > |
From: Mitra <mi...@ea...> - 2003-03-03 04:23:35
|
Jakub - I think this is yours? I had problems with an anonymous form, it goes into a black hole - turns out it is in EventItemAfterUpdate, the code never returns. Really hard to debug .... since it was a Post, if you can't repeat it, let me know and I'll try and help. - 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 |