Forum OpenACS Q&A: Response to Download module error

Collapse
Posted by Vinod Kurup on
Hi Christopher,

First thing - when posting logs, enclose them in <pre> tags and choose the HTML option. This makes it a lot easier to read.

It seems that the download module doesn't properly handle the case when version_id is null.

In download-add-rule-2.tcl, change:

validate_integer version_id $version_id
to
validate_integer_or_null version_id $version_id
At the bottom of the same file, change:
insert into download_rules (rule_id, version_id, download_id, visibility, price, currency) values ($new_rule_id, '$version_id', $download_id, '$QQvisibility', '$price', '$QQcurrency')"
to
insert into download_rules (rule_id, version_id, download_id, visibility, price, currency) values ($new_rule_id, [ad_decode $version_id "" [db_null] "$version_id"], $download_id, '$QQvisibility', '$price', '$QQcurrency')"
You'll have to make these same changes in the file download-update-rule.tcl

This seems to make it work, but I haven't tested it extensively. Good luck!