Forum OpenACS Development: Re: Parsing PHP array

Collapse
9: Re: Parsing PHP array (response to 1)
Posted by Iuri Sampaio on
Torben,

There's something wrong with ad_proc qf_get_inputs_as_array. Its behavior's unstable as sometimes it works fine but other just doesn't.

Sometimes I get errors as qf_get_inputs_as_array wasn't installed.

"... invalid command name "qf_get_inputs_as_array ..."

Have you ever face anything similar to that?
How did you fix it?

The chunk of code that generates logs on error.log is bellow:

1. Logs with ad_proc working fine
2. Logs with ad_proc returning error

...

qf_get_inputs_as_array $expArray


set query_key_list [array names $expArray]

# ns_log Notice "TETETE $query_key_list"
foreach query_key $query_key_list {
ns_log Notice "$query_key \n"
}

#####
##1
#####

[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: FORM
Unamed set:
firstname = Iuri
lastname = Sampaio
phone = 9876545678
email = mailto:iuri.sampaio@iurix.com
newsletter_p =
date1_day = 24
date1_month = 09
date1_year = 2013
date1 = 09/24/2013
date2_day = 25
date2_month = 09
date2_year = 2013
date2 = 09/25/2013
date3_day = 27
date3_month = 09
date3_year = 2013
date3 = 09/27/2013
message = fvsdvaeveav
locale =
product = Great Experience
expArray = Array
...

[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date2
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date2_year
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date3
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: firstname
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: newsletter_p
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date1_month
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: lastname
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date2_month
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date3_month
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date1_year
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: locale
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: email
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date3_year
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: product
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: phone
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date1_day
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: expArray
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date2_day
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: message
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date3_day
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: date1
[20/Sep/2013:09:44:03][18605.615929600][-default:3-] Notice: Send Email

#####
## 2.
#####

But sometimes it doesn't. And I have no clue why that instability.

[20/Sep/2013:09:41:18][18605.616986368][-default:0-] Error: POST http://ecommerce.natopia.com/notifications/check-availability?
referred by "http://dev.natopia.com/experiences/details/great-experience"
invalid command name "qf_get_inputs_as_array"
while executing
"qf_get_inputs_as_array $expArray"
("uplevel" body line 38)
invoked from within
"uplevel {
ad_page_contract {
} {
{firstname ""}
{lastname ""}
{email ""}
{product ""}
{phone ""}
{email ""}
{newsletter_p ..."
(procedure "code::tcl::/var/www/natopia/packages/natopia-notifications/w..." line 2)
invoked from within
"code::tcl::$__adp_stub"
("uplevel" body line 12)
invoked from within
"uplevel {