Forum OpenACS Development: ad_proc [cc_email_user] returns blank
I've noticed that ad_proc [cc_email_user $email] has stopped to return the user_id, but only for new users.
The problem started after I moved user-new.tcl script to a custom pkg and customized the registration form, adding one more field.
Even though I had copied the whole TCL script into the new file, it seems the execution of registration process has broken at some point, that new users are not 100% persisted into database anymore.
Maybe, moving the registration outside acs-subsite could have broken something related to auth ad_procs. I've debugged every line of acs-subsite/lib/user-new.tcl but I found no references to extra scripts or callbacks whatsoever.
Should I be looking somewhere else?
ad_proc cc_email_user runs the private ad_proc cc_lookup_email_user, which runs the SQL line as follows.
select user_id from acs_users_all where lower(email) = lower(:email)
By runing the query alone within pgsql shell prompt, the user_id is properly returned.
Thus, I have flushed the memory and restarted NaviServer, but the problem still persists.
Just out of curiosity, what happens if you replace cc_email_user with its non-deprecated alternative party::get_by_email?
Then, I try to get its info but it returns blank.
set token [parameter::get -parameter "WebAppAccessToken" -package_id 15689]
Noticing that parameter::get returns value to core existent params.
parameter::get -parameter "PortletTemplate" -package_id 4796
I do remember that Gustaf mentioned some enhancements, in a previous forum thread, plus there's a new ad_proc to solve the problem. I'd need to look at api-doc its prototype.
set token [parameter::get_global_value -package_key "evex-rest" -parameter "WebAppAccessToken"]
which brings global and instance contexts.
Would make sense an enhancement to parameter::get to have a new argument? (i.e. -scope "global/instance")
1. cc_email_user and party::get_by_email; and
2. parameter::get and parameter::get_global_value;
1) you should replace deprecated calls by non-deprecated calls. Nobody will fix deprecated calls. OpenACS warns you, when you use deprecated calls.
2) parameter::get_global_value is not really new, it was introduced in 2010 
I knew about 2, but I didn't about 1! I should have looked at /api-doc in OpenACS.org, instead of my own box.
set user_id [cc_lookup_email_user $email]
There's a core change that must be applied.