Forum OpenACS Q&A: Is custom sections ported? Is this the fix?

There are 4 occurances of ns_ora in /admin/custom-sections. Of course they cause errors. In add-pages-2.tcl, line 49 reads

ns_ora clob_dml $db "
insert into content_files
(content_file_id, section_id, file_name, file_type, page_pretty_name, body, html_p)
values
($content_file_id, $section_id, '$QQfile_name', 'text/html', '$QQpage_pretty_name', empty_clob(), '$QQhtml_p')
returning body
into :1" $body

We changed it to

ns_db dml $db "
insert into content_files
(content_file_id, section_id, file_name, file_type, page_pretty_name, body, html_p)
values
($content_file_id, $section_id, '$QQfile_name', 'text/html', '$QQpage_pretty_name', '$body', '$QQhtml_p')"

Is this module not yet ported? Did we fix it correctly?

Collapse
Posted by Don Baccus on
Looks like you caught us on some unported code, good.

Two comments:

1. Please submit this to the SDM, along with your proposed fix, so we remember to fold it in to the sources.

2. You should be inserting '$QQbody', not '$body' - the QQ version of the variable as apostrophes doubled, just inserting '$body' will cause  an error if the body contains an apostrophe.  When inserting CLOBs using the aD Oracle driver for AOLserver (as opposed to inserting normal varchars) apostgrophe's aren't a problem, thus the original use of '$body'.