Forum OpenACS Q&A: Problem with ad_script_abort on include

Request notifications

Hello,

I am currently using the “assessment” package running on the OpenACS 5.9.1 version. I’ve been displayed an error on the log when a user submits the surveys. The problem is because there is an ad_script_abort inside of an include.

The following is an extract of the log:

[08/May/2018:16:44:29][27793.345286400][-default:1-] Error: Error in include template "/var/www/encuestas/packages/assessment/lib/feedback":

called from adp_parse_ad_conn_file

called from rp_serve_concrete_file /var/www/encuestas/packages/assessment/www/feedback.adp

called from rp_serve_abstract_file /var/www/encuestas/packages/assessment/www/feedback

called from rp_handle_request

called from rp_handler

On the developer support requests, it shows the following:

AGE: /packages/assessment/lib/assessment
------------------------------------------------------------
while executing
"ad_raise ad_script_abort"
(procedure "ad_script_abort" line 2)
invoked from within
"ad_script_abort"
("uplevel" body line 30)
invoked from within
"uplevel #$level $after_submit"
(procedure "ad_form" line 726)
invoked from within
"ad_form -extend -name show_item_form -validate {{response_to_item.1014 {[exists_and_not_null response_to_item(1014)]} "[_ assessment.form_element_requ..."
("eval" body line 1)
invoked from within
"eval ad_form -extend -name show_item_form -validate "{$validate_list}" -on_submit $on_submit -after_submit $after_submit"
("uplevel" body line 575)
invoked from within
"uplevel {
ad_page_contract {

This page allows to display an assessment with sections and items

@author Eduardo Pérez Ureta (mailto:eperez@it.u..."

(procedure "code::tcl::/var/www/encuestas/packages/assessment/lib/assess..." line 2)
invoked from within
"code::tcl::$__adp_stub"
("uplevel" body line 12)
invoked from within
"uplevel {
if { [file exists $__adp_stub.tcl] } {
# ensure that data source preparation procedure exists and is up-to-date
..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare"
invoked from within
"template::adp_parse [template::util::url_to_file "/packages/assessment/lib/assessment" "$__adp_stub"] [list]"
("::try" body line 2)

In order to replicate the error I have made a simple script with an “ad_script_abort” and perform an include of this script within another and the error displays.

My question if it is an OpenACS error or the way of implementation found in the assessment package.

Thanks in advance

Collapse
Posted by Gustaf Neumann on
With the head version, everything looks ok, ... but there have been several changes in the error management in the last months. See below for a couple of script aborts with error calls from other includes...

maybe a version issue? what version of assessment are you using with OpenACS5.9.1? Do you get the same error when your create a simple .adp page in openacs-4/www including the ad_script_abort command?

% fgrep -B3 ad_script_abort packages/acs*/lib/*tcl

acs-admin/lib/password-update.tcl-
acs-admin/lib/password-update.tcl-if { ![auth::password::can_change_p -user_id $user_id] } {
acs-admin/lib/password-update.tcl-    ad_return_error "Not supported" "Changing password is not supported."
acs-admin/lib/password-update.tcl:    ad_script_abort
--
acs-admin/lib/service-parameters.tcl-    ad_return_forbidden \
acs-admin/lib/service-parameters.tcl-        "Permission Denied" \
acs-admin/lib/service-parameters.tcl-        "<blockquote>You don't have permission to view this page.</blockquote>"
acs-admin/lib/service-parameters.tcl:    ad_script_abort
--
acs-subsite/lib/login.tcl-         || $time < [ns_time] - $expiration_time
acs-subsite/lib/login.tcl-     } {
acs-subsite/lib/login.tcl-        ad_returnredirect -message [_ acs-subsite.Login_has_expired] -- [export_vars -base [ad_conn url] { return_url }]
acs-subsite/lib/login.tcl:        ad_script_abort
--
acs-subsite/lib/user-new.tcl-            if {[parameter::get -parameter RegistrationRequiresApprovalP -default 0] &&
acs-subsite/lib/user-new.tcl-                $creation_info(account_status) eq "closed"} {
acs-subsite/lib/user-new.tcl-                    ad_return_warning "Account approval is required" $creation_info(account_message)
acs-subsite/lib/user-new.tcl:                    ad_script_abort