Penny Leach
added a comment - 15/Jan/08 9:32 AM patch against 1.9 (very similar to patch against head)
diff in lib/locallib.php which contains instructions also has some notes on other local/ stuff I'm working on (lang (almost ready to commit) and admin tree <-- already committed)

We implemented this at the OU, but assumed that no-one else would want it in core. Anyway, if this is going in to core, it would be really good if it could be done in a way that is compatible with what we are already using.

We went for capabilites with names like local/something:somethingmorespecific.

Tim Hunt
added a comment - 15/Jan/08 8:29 PM Was reading back through the chat about this on Moodle HQ.
We implemented this at the OU, but assumed that no-one else would want it in core. Anyway, if this is going in to core, it would be really good if it could be done in a way that is compatible with what we are already using.
We went for capabilites with names like local/something:somethingmorespecific.
I guess I had better make a patch.

Tim Hunt
added a comment - 15/Jan/08 8:38 PM The language string for capability local/something:somethingmorespecific would be get_string('somethingmorespecific', 'something');, which we would put in lang/en_utf8_local
I think the attached patch is all the code we added to make this work. It's suprisingly small.

Drat! I am being really unobservant I now notice you have already committed your changes, which are incompatible with what we have been doing for ages. RANT! Shouldn't you have posted about this in the General Developer Forum and given people a few days to comment? As Martin Langhoff would say, we need to hold these discussions in public, not just in Moodle HQ chat.

Tim Hunt
added a comment - 15/Jan/08 8:50 PM Drat! I am being really unobservant I now notice you have already committed your changes, which are incompatible with what we have been doing for ages. RANT! Shouldn't you have posted about this in the General Developer Forum and given people a few days to comment? As Martin Langhoff would say, we need to hold these discussions in public, not just in Moodle HQ chat.

About the 'more specific' stuff, did you read the long conversation about whether local/ should be a plugin itself or a plugin system? I actually started off with a patch very similar to yours, but changed it so that local/ ended up not having 'sub' components.

Regarding the "shouldn't I have posted about this in GDF" - tbh, I really didn't think it was necessary given that it was such a tiny patch and only affected local/ not core.

I can't really keep up on whether we should discuss these things in bugs, forums or skype chat either. All three seems a bit excessive. Admittedly I created the bug but then MD and I discussed it in skype rather than here, which was probably incorrect. I'm not convinced GDF is the best place though - surely this is what the tracker is for ?

Penny Leach
added a comment - 16/Jan/08 2:14 AM Tim -
About the 'more specific' stuff, did you read the long conversation about whether local/ should be a plugin itself or a plugin system? I actually started off with a patch very similar to yours, but changed it so that local/ ended up not having 'sub' components.
Regarding the "shouldn't I have posted about this in GDF" - tbh, I really didn't think it was necessary given that it was such a tiny patch and only affected local/ not core.
I can't really keep up on whether we should discuss these things in bugs, forums or skype chat either. All three seems a bit excessive. Admittedly I created the bug but then MD and I discussed it in skype rather than here, which was probably incorrect. I'm not convinced GDF is the best place though - surely this is what the tracker is for ?

Penny Leach
added a comment - 16/Jan/08 3:14 AM Also, just to piss you off even more You should probably take a look at MDL-13001 and MDL-11561 which add support for local/lang and local/settings.php respectively.

Shane Elliott
added a comment - 30/Jun/08 2:09 PM Noticed that there was no call to update_capabilities in lib/locallib.php to actually process local/db/access.php - have submitted a fix to CVS for 1.9 and HEAD

Sorry for comment a closed issue, but I've followed the 1.9.3 lib/locallib.php instructions to add new local capabilities; it creates the capabilities, but the installation script enters to update_capabilities function every time upgrade_local_db is called, and it crashes the second time trying to insert the same defined local capabilities to db.

In your attached patch, update_capabilities is called before local_version config var is set, I think that's the right way, but in 1.10.2.4 lib/locallib.php revision, update_capabilities call is in another place

David Monllaó
added a comment - 05/Nov/08 8:43 PM Sorry for comment a closed issue, but I've followed the 1.9.3 lib/locallib.php instructions to add new local capabilities; it creates the capabilities, but the installation script enters to update_capabilities function every time upgrade_local_db is called, and it crashes the second time trying to insert the same defined local capabilities to db.
In your attached patch, update_capabilities is called before local_version config var is set, I think that's the right way, but in 1.10.2.4 lib/locallib.php revision, update_capabilities call is in another place

Penny Leach
added a comment - 06/Nov/08 5:35 PM > and it crashes the second time trying to insert the same defined local capabilities to db.
What do you mean by 'crashes'- can you give me exact errors?
The capabilities should be safe to add multiple times because assign_capability is duplicate-safe. Else you would get the same problem everytime you bumped the version number.