Forum OpenACS Development: Notice: Deprecated proc ad_parameter used

I'm completely agree about this effort (to point out the bunch of deprecated procedures) but, can I disable this notice via parameters?

I can disable editing file but I'd like to know if it is some way to do it via configuraton file or parameters

Collapse
Posted by Gustaf Neumann on
There are (were) tons of calls to functions, that were deprecated since the beginning of the openACS CVS. Part of the rework of in 5.8 is to get rid of such calls. All the 45 packages in oacs-5-8 (and additionally the 19 packages in use on openacs.org, committed to head) are now free of deprecated calls. As long nobody is aware of the deprecated calls, nobody does anything against it and the mess continues.

From which package do see get the messages?

I can imagine this is a big effort. I appreciate very much your effort in "simplify" this big piece of software 😊 . I'd read that Victor was checking this "deprecated procs" and it is a good idea.

If you want I can put it here (or "grepped" my logs). Until now I can see these warnings (a lot) in several packages:

lars-blogger
photo-album
edit-this-page

Collapse
Posted by Gustaf Neumann on
the following packages in the HEAD version of OpenACS should be free of deprecated calls:
HEAD     bookmarks
HEAD     bug-tracker
HEAD     directory
HEAD     download
HEAD     edit-this-page
HEAD     irc-logger
HEAD     lars-blogger
HEAD     oct-election
HEAD     photo-album
HEAD     ref-us-counties
HEAD     ref-us-states
HEAD     schema-browser
HEAD     static-pages
HEAD     trackback
HEAD     user-preferences
HEAD     workflow
HEAD     wp-slim
HEAD     xml-rpc
The message should go away, when you upgrade these packages from CVS HEAD.
photo-album and edit-this-page OK but lars-blogger has some errors :

Logs:

[30/Oct/2013:12:53:24][39466.220049408][-default:14-] Notice: Deprecated proc ad_parameter used:
    called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry {}
    called from adp_parse_ad_conn_file
    called from rp_serve_concrete_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry.adp
    called from rp_serve_abstract_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry
    called from rp_handler

[30/Oct/2013:12:53:24][39466.220049408][-default:14-] Notice: Deprecated proc ad_parameter used: called from lars_blog_public_package_url -package_id 36280 called from lars_blogger::entry::get -entry_id 82346 -array blog called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry {} called from adp_parse_ad_conn_file called from rp_serve_concrete_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry.adp called from rp_serve_abstract_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry called from rp_handler

Collapse
Posted by Gustaf Neumann on
I tried and doesn't work. Same warning:

[30/Oct/2013:21:47:34][41659.246280192][-default:7-] Notice: Deprecated proc ad_parameter used:
    called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry {}
    called from adp_parse_ad_conn_file
    called from rp_serve_concrete_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry.adp
    called from rp_serve_abstract_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry
    called from rp_handler

[30/Oct/2013:21:47:34][41659.246280192][-default:7-] Notice: Deprecated proc ad_parameter used: called from lars_blog_public_package_url -package_id 36280 called from lars_blogger::entry::get -entry_id 82346 -array blog called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry {} called from adp_parse_ad_conn_file called from rp_serve_concrete_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry.adp called from rp_serve_abstract_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry called from rp_handler

Might it be I had something wrong when update lars-blogger?

Collapse
Posted by Gustaf Neumann on
Something went wrong in your update. See [1] in line 8, there was previously ad_parameter, and there is now parameter::get. check Your packages/lars-blogger/www/one-entry.tcl to see whether the update was successful

-g
[1] http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/lars-blogger/www/one-entry.tcl?hb=true

I'll test it again and this is the Notice:

--- Some Logs ---

Notice: Deprecated proc ad_parameter used:
    called from lars_blog_public_package_url -package_id 36280
    called from lars_blogger::entry::get -entry_id 82346 -array blog
    called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry {}
    called from adp_parse_ad_conn_file
    called from rp_serve_concrete_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry.adp
    called from rp_serve_abstract_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry
    called from rp_handler

[31/Oct/2013:09:42:24][43770.189730816][-default:0-] Notice: Deprecated proc ad_parameter used: called from lars_blog_header_background_color called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry {} called from adp_parse_ad_conn_file called from rp_serve_concrete_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry.adp called from rp_serve_abstract_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry called from rp_handler

called from lars_blog_categories_p -package_id 36280 called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/entry-chunk {& blog screen_name {} perma_p 1 max_content_length 0 manageown_p 0 unpublish_p 1 / /} called from template::adp_parse /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry {} called from adp_parse_ad_conn_file called from rp_serve_concrete_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry.adp called from rp_serve_abstract_file /Users/cesareox/Documents/openacs/packages/lars-blogger/www/one-entry called from rp_handler

I've done a some check in my code (I've run cvs update) and, might you please change these lines:
lib/lars-blogger-procs.tcl
http://cvs.openacs.org/changelog/OpenACS?cs=MAIN%3Agustafn%3A20131030173708
(lines 137, 156, 165)

And I'll run "cvs update" and test. Thanks!

Collapse
Posted by Gustaf Neumann on
you are right, i missed 3 further occurances of ad_parameter (lars blogger is installed on openacs.org, but not in use). This is fixed now in cvs HEAD.

all the best
-g

cvs update ...

restart openacs and ...

voilá 😉

If I see further occurences in some package I'll post them here.

Thanks!

Collapse
Posted by Gustaf Neumann on
Great. Please do so! -g
Hi Gustaf

I put here some new findings of "deprecated warning" in my logs. Two new packages:

* Comments Package:
In openacs/packages/general-comments/www/comment-add (and comment-add-2 and 3 ...)
Notice: Deprecated proc ad_require_permission used:
Notice: Deprecated proc export_form_vars used:

It ends in error:
ERROR: column "get_value__parameter_id" does not exist at character 128
QUERY: select attr_value from apm_parameter_values v
where v.package_id = get_value__package_id
and parameter_id = get_value__parameter_id

* Survey Package
In openacs/packages/survey/www/index
Notice: Deprecated proc ad_maybe_redirect_for_registration used:
Notice: Deprecated proc ad_permission_p used:

In openacs/packages/survey/www/respond
Notice: Deprecated proc ad_maybe_redirect_for_registration used:
Notice: Deprecated proc ad_require_permission used:
Notice: Deprecated proc ad_get_user_id used:
Notice: Deprecated proc ad_get_user_id used:
Notice: Deprecated proc philg_quote_double_quotes used:
Notice: Deprecated proc ad_get_user_id used:
Notice: Deprecated proc philg_quote_double_quotes used:
Notice: Deprecated proc export_form_vars used:

(I think that some warnings might be caused of some custom code)

Collapse
Posted by Gustaf Neumann on
You should use general-comments from the oacs-5-8 branch. Below is the list of the cleaned-up packages from openacs.org.
HEAD     bookmarks
HEAD     bug-tracker
HEAD     directory
HEAD     download
HEAD     edit-this-page
HEAD     irc-logger
HEAD     lars-blogger
HEAD     oct-election
HEAD     photo-album
HEAD     ref-us-counties
HEAD     ref-us-states
HEAD     schema-browser
HEAD     static-pages
HEAD     trackback
HEAD     user-preferences
HEAD     workflow
HEAD     wp-slim
HEAD     xml-rpc
HEAD     xolirc
oacs-5-8 acs-admin
oacs-5-8 acs-api-browser
oacs-5-8 acs-authentication
oacs-5-8 acs-automated-testing
oacs-5-8 acs-bootstrap-installer
oacs-5-8 acs-content-repository
oacs-5-8 acs-core-docs
oacs-5-8 acs-datetime
oacs-5-8 acs-developer-support
oacs-5-8 acs-events
oacs-5-8 acs-kernel
oacs-5-8 acs-lang
oacs-5-8 acs-mail-lite
oacs-5-8 acs-messaging
oacs-5-8 acs-reference
oacs-5-8 acs-service-contract
oacs-5-8 acs-subsite
oacs-5-8 acs-tcl
oacs-5-8 acs-templating
oacs-5-8 acs-translations
oacs-5-8 ajaxhelper
oacs-5-8 attachments
oacs-5-8 calendar
oacs-5-8 categories
oacs-5-8 faq
oacs-5-8 file-storage
oacs-5-8 forums
oacs-5-8 general-comments
oacs-5-8 news
oacs-5-8 notifications
oacs-5-8 oacs-dav
oacs-5-8 openacs-default-theme
oacs-5-8 ref-countries
oacs-5-8 ref-language
oacs-5-8 ref-timezones
oacs-5-8 rss-support
oacs-5-8 search
oacs-5-8 tsearch2-driver
oacs-5-8 xotcl-core
oacs-5-8 xotcl-request-monitor
oacs-5-8 xowiki
"survey" is not on my watch-list, we use it nowhere, therefore i have not touched it. Since you seem to be using it, and i am still in cleanup mode, i can put some effort into this package as well.

Concerning the SQL error: this seems unrelated to me. As it looks, the change [1] from October 2010 is missing. Interestingly, i can't find an upgrade script for this function, so this was probably forgotten. will take care for this as well on the next opportunity.

-gustaf neumann

[1] http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql?r2=1.74&r1=1.73

Hi!

OK, I'd checked out with cvs checkout (not cvs checkout -r oacs-5.8.0 . Now it is working nice. I had some confusion. I'll keep in mind this list to checkout all my "deprecated proc" warnings. Thanks for the cleanup, I think it's worthy.

About survey, as you wish. I can do it cleanup in my installation or test your cleanup (but if anybody is using it perhaps it doesn't worth the effort).

Concerning SQL error. Yes, it is unrelated with this (I'll follow up with this in a specific thread, ok?)

Collapse
Posted by Gustaf Neumann on
Hi Cesareo,

the following changeset updates the "survey" packages to a similar level as the packages in the oacs-5-8 branch. Note, that the update for this package happened in the HEAD branch.
Hope, i got everything. Please test.

-g
http://cvs.openacs.org/changelog/OpenACS?cs=MAIN%3Agustafn%3A20131106073353

Hi Gustaf

Ok, Thanks. "deprecated proc warning dissapear". There are some "....has no doc(title) set"

I had an error (I'll open a new thread now (I put my self in "test mode" to check the package)

I'll keep here if I get more "deprecated proc warnings" and I'll take in mind the list above.

Thanks so much for the "fall cleanup" (or in this South Hemisphere Spring Cleanup 😉 )

Collapse
Posted by Gustaf Neumann on
good. will look at this as well. -g
Collapse
Posted by Gustaf Neumann on
fixed the passing on one place (in cvs HEAD), please recheck.
Sorry, I didn't understand. Do you mean, all packages en cvs HEAD has been checked?

I'm checking logs to see what "deprecated warnings" appears. I'm going very slow because I've to merge some code (and I inherit deprecated procs).

Collapse
Posted by Gustaf Neumann on
no, not all packages! this was a followup to the "....has no doc(title) set" in the "survey" package, where i wrote previously "will look at this as well."
Ah ok 😊. Anyway, As I check my logs, I use this list to upgrade my packages.
Collapse
Posted by Ivan Mata on
Good afternoon, I have a question, I am using OpenACS 5.8.1, migrated from OpenACS 5.5.1, but the procedures in the set-operation-procs.tcl appears as deprecated (set_intersection, set_append, set_member, and others).

Why have it changed?
What should I use to replace them?

Collapse
Posted by Gustaf Neumann on
Dear Ivan,

The main reason for deprecating these functions was probably that none of the 330 packages in CVS uses these functions, tcllib contains a more complete collection of functions (package req struct::set, see [1]) and maybe to provoke feedback like this one :)

I would recommend to use struct::set, which is the standard tcl-way; another option would be to make an own package "setutils", having these functions non-deprecated. The probably most efficient counterpart for set_member is the "in" expression (e.g. "if {$x in $set} ...").

all the best
-g

[1] http://docs.activestate.com/activetcl/8.5/tcllib/struct/struct_set.html

Collapse
Posted by Ivan Mata on
Dear Gustaf,

Thank you very much for your answer, I will take your recommendations.

all the best.