Forum OpenACS Development: Bug within application-add

Collapse
Posted by Iuri Sampaio on
Hi there,

It's been a while I don't post threads.
So, I thought the OCT could be missing me. :)

Here it goes a bug that I found on acs-subsite pkg.

I tried to create an application filling up the form field "URL folder name" with the value "resources" and I got the warning message:
"This folder name is already used"

However I didn't find any reference/record to that value within the tables: acs_objects, apm_packages, apm_services, cr_item and cr_folders.

Moreover, I went to the file that throws the warning message:
"This folder name is already used", which is /packages/acs-subsite/www/admin/applications/application-add.tcl line 80

if { $folder eq "" } {
form set_error application folder "This folder name is already used"
break
}

Debugging it further i verified that the ad_proc right above the if statement returns the value " ".

set folder [site_node::verify_folder_name \
-parent_node_id [ad_conn node_id] \
-current_node_id $current_node_id \
-folder $folder \
-instance_name $instance_name]

It returns the blank value " " which is quite different from "" as in: $folder eq ""

Moreover I modified it the if statement to:

if { [exists_and_not_null folder] } {
if { [exists_and_not_nu$folder eq "" } {
form set_error application folder "This folder name is already used"
break
}

Then I finally could create the application with "URL folder name" set to "resources.

I wish I could help more

Collapse
Posted by Ryan Gallimore on
resources is a reserved folder name for package resources in the Request Processor, ie. static files that are accessed via domain.com/resources/package-key/styles/style.css but located in /packages/package-key/www/resources/styles/style.css.

For more information, grep the acs-tcl package for "resources".

I recommend you choose another folder name.

Collapse
Posted by Jim Lynch on
So first, the actual problem was caused by choosing a reserved name for a content repository folder, so this is not a bug in application-add, it's in your choice of folder name. I take it this restriction and especially its reason for being is not documented somewhere?

Having said that, why would the folder name for a -content repository- folder be restricted when the restriction is on the name of an -operating system- directory? Or, is this a restriction on both either for the same reason or for separate reasons?

-Jim