Forum OpenACS Development: Fixes / Changes from ]po[

Collapse
Posted by Malte Sussdorff on
I have a couple of changes Frank made to his repository in the core packages. I can easily create git diffs like the following and provide these back to the community.

Is it okay if I posted them here in a thread per package, as it would be quite a lot of work to get the whole system setup so I can create the proper patches. And the changes are not manifold and need to be looked at anyway 😊.

NOTE: I filter things which are really ]po[ specific (e.g. fixes to 5.2.x upgrade scripts) but other than that I did not write the patch, neither the commit message. I am just trying to do the job ]project-open[ should be doing as a good community member.

Best wishes
Malte

commit 031041e4ab93e559a12a1bda5fe6a34ab227e7d7
Date: Wed Jan 5 18:02:00 2011 +0000

- fixed issue with deleting authorities

diff --git a/sql/postgresql/authentication-package-create.sql b/sql/postgresql/authentication-package-create.sql
index ee559d3..6202929 100644
--- a/sql/postgresql/authentication-package-create.sql
+++ b/sql/postgresql/authentication-package-create.sql
@@ -89,6 +89,10 @@ returns integer as '
declare
p_authority_id alias for $1;
begin
+
+ delete from auth_driver_params
+ where authority_id = p_authority_id;
+
perform acs_object__delete(p_authority_id);

return 0;

malte-sussdorffs-mac-mini:acs-kernel malte$ git show 402d338129dadca68240d309df9736b351a5e14a
commit 402d338129dadca68240d309df9736b351a5e14a
Date: Wed Jan 19 10:29:07 2011 +0000

- fixed V4.0 upgrade issue

diff --git a/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql b/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql
index f025d55..201535b 100644
--- a/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql
+++ b/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql
@@ -2,7 +2,7 @@
create function inline_0 ()
returns integer as '
declare
- one_user_id integer;
+ one_user_id RECORD;
bio_id integer;
bio_mime_type_id integer;
attr_id integer;
@@ -40,14 +40,14 @@ begin
for one_user_id in select user_id from users loop
if exists(select attr_value
from acs_attribute_values
- where object_id = one_user_id
+ where object_id = one_user_id.user_id
and attribute_id = bio_id) then
update persons
set bio = (select attr_value
from acs_attribute_values
- where object_id = one_user_id
+ where object_id = one_user_id.user_id
and attribute_id = bio_id)
- where person_id = one_user_id;
+ where person_id = one_user_id.user_id;
end if;
end loop;