Forum OpenACS Q&A: folder-edit on photo-album error

Collapse
Posted by Eric Wolfram on
I go to my photo-album and I want to edit the folders. My page is similar to this:
https://openacs.org/picture/

With admin permissions, I see an "Edit folder information" link, which takes me to an edit-folder page -- a form with two fields, as in:

Edit the Folder:
_#Folder Name# * ______________________
_#Folder Description# ________________________

When I change the values of the field and submit, I expect the folder name and description to change, however, an error * on the web page appears with an error ** in the error log. Is something wrong with content_folder.rename or does anyone see some obvious issue with this snippet of code on:

packages/photo-album/www/folder-edit.tcl

SNIPPIT OF CODE THAT'S FAILING
from photo-album/www/folder-edit.tcl

# edit the folder
db_transaction {

db_exec_plsql edit_folder {
begin
content_folder.rename (
folder_id => :folder_id,
label => :label,
description => :description
);
end;
}

} on_error {
ad_return_complaint 1 "[_ photo-album._An]"

ad_script_abort
}

** 1

ERROR FROM WEB PAGE

Problem with your input

We had a problem with your input:

An error occurred while processing your input. Please let the system owner know about this.

$errmsg

Please back up using your browser, correct the above , and resubmit your entry.

Thank you.

*** 2

ERROR FROM ERROR.LOG

[04/Apr/2005:19:47:56][32276.65540][-conn:openacs::0] Error: Ns_PgExec: result status: 7 message: ERROR: function content_folder__rename("unknown", "unknown", "unknown", "unknown") does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.

Collapse
Posted by Dave Bauer on
Which version on acs-content-repository are you using?

The function was changed to "edit_name" with the same arguments. Apparentely photo-album was not updated at the same time.

Collapse
Posted by Eric Wolfram on
# Which version on acs-content-repository are you using?

url="acs-content-repository" version="5.1.5"

# The function was changed to "edit_name" with the same
# arguments. Apparentely photo-album was not updated at
# the same time.

What function? edit_folder?

Collapse
Posted by Dave Bauer on
content_folder.rename

was changed to

content_folder.edit_name

to resolve compatibility problems with Oracle9

The code in photo album is still calling the old pl/sql function name.

Look in folder-edit-oracle.xql

Collapse
Posted by Eric Wolfram on
Hmmm, I'd love to look in folder-edit-oracle.xql. I'm not finding that file...

[ewolfram@wolfram packages]$ find * folder-edit-oracle.xql
find: folder-edit-oracle.xql: No such file or directory

Does it have a path? Or should I look in hte cvs.openacs.org and not in my file system. I don't mean to be daft...I can't help it :-)

Collapse
Posted by Dave Bauer on
Its right next to packages/photo-album/www/folder-edit.tcl
in packages/photo-album/www/folder-edit-oracle.xql

At least on openacs 5.1.5 it is. Hmmm. ah i see you are using postgresql, for some reason I thought you were using Oracle.

So even if you can find the oracle.xql don't worry about that. You need packages/photo-album/www/folder-edit-postgresql.xql.

In there it will look like this:
select content_folder__rename (

Change it to
select content_folder__edit_name (

It looks like your photo-album package is not up to date. Check to see which version it is. The current version in oacs-5-1 CVS has the correct function name.

Collapse
Posted by Eric Wolfram on
sorry, I found it and resolved the issue. I edited
/packages/photo-album/www/folder-edit-oracle.xql
/packages/photo-album/www/folder-edit-postgresql.xql
/packages/photo-album/www/folder-edit.tcl

I changed all instances of

content_folder.rename

to:

content_folder.edit_name

in the postgres file it was:

content_folder__edit_name

I then had to "reload" the files in photo-album from some tool in the admin area...I guess restarting the server would have done it too...but reloading resolved the isssue! Yeah! Thanks D!

e

Collapse
Posted by Eric Wolfram on
FYI, my version of photo-album is:

version name="5.0d1"
url="http://xarg.net/download/photo-album-5.0d1.apm";

It looks like you're correct...old photo-album code....but I'm used to that... I still use openAcs 4.2 on mytlc.com and I use a totally old-school 3.2 version for an intranet!

However, I have to say that openACS 5 has positive improvements over 4.2. The whole 5.x acs experience dominates over the 4.2 experience. :-) Good choices overall, not to mention the obvious improvements like languages.
e