Forum OpenACS Q&A: Undelete a user in 4.5?

Collapse
Posted by Ola Hansson on
Grrr! I just accidentally(!) deleted myself from the the system when fiddling around with the pages under /acs-admin/users/ in OpenACS 4, Postgres...

I would like to restore my account if possible and to my satisfaction I noticed that the entries in tables such as PARTIES, PERSONS and USERS are still intact. But the "member_state" found in MEMBERSHIP_RELS is gone.

I tried to restore the account by inserting the user_id that was once mine along with the member_state 'approved', without success, though.

infogettable-dev=# select * from membership_rels;
 rel_id | member_state 
--------+--------------
   2892 | approved     <-- another user. my row was deleted😟   
  
(1 row)

infogettable-dev=# insert into membership_rels values 
(2426,'approved');
NOTICE:  Error occurred while executing PL/pgSQL function 
membership_rels_in_tr
NOTICE:  line 21 at SQL statement
ERROR:  ExecAppend: Fail to add null value in not null attribute 
group_id

Is there a quick fix for this, or should I register a new account?
Collapse
Posted by Jade Rubick on
I don't know (maybe someone else here does), but you might try disabling the membership_rels_in_tr before adding the values, and see if that works. Or at least search for this trigger and see what it does.
Collapse
Posted by Rafael Calvo on
This seems to be the same bug I reported here.
user management seems to have more problems than in previous OACS versions...
Collapse
Posted by Vinod Kurup on
I think the problem is that there are 2 similar procs in the membership_rel package.
  • membership_rel__delete deletes the entire acs_rel
  • membership_rel__deleted simply changes the state of the rel to 'deleted'
The user deletion pages should be calling the second one, but instead they are calling the first one. Simple patch for PG and Oracle (to CVS head) available here.
Collapse
Posted by Jon Griffin on
Another case of crappy naming. This should really be named set_deleted to avoid confusion. (patch forthcoming)