Forum .LRN Q&A: Department keys

Collapse
Posted by Oscar Bonilla on
Is there any reason why department keys are derived from department names? I have a situation in which department names can be duplicated and thus department_key has a conflict. I could make up my own keys and insert them directly into the dotlrn_departments table, but I wanted to check wether this was something that needs to be fixed globally.

From /packages/dotlrn/tcl/dotlrn-security-procs.tcl in generate_key

      Generate a key from a name. Compresses all adjacent non-alphanum chars to a dash. Yes, this is not unique, grows rapidly, will need collision detection and resolution, yada yada.

Any coments on this? What would be a good way to generate keys?

Regards,

-Oscar

Collapse
2: Re: Department keys (response to 1)
Posted by Tilmann Singer on
You could use util_text_to_url which does automatic conflict resolution if you tell it to. According to this bug https://openacs.org/bugtracker/openacs/com/dotlrn/bug?bug%5fnumber=189 it should have been incorporated in dotlrn already, but since you are asking it apparently isn't. Or maybe it only went into 4.7.
Collapse
3: Re: Department keys (response to 1)
Posted by Oscar Bonilla on
The change is there, but the call to generate_key in dotlrn_department::new does not use the -increment flag in the call to generate_key. I think it should. Any resons why it doesn't or should I submit a bug report.

Thanks,

-Oscar