Issue Details (XML | Word | Printable)

Key: MDL-13808
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Petr Škoda (skodak)
Reporter: Matt Clarkson
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-17458

Proposal to move the module post install hook to after the site course setup

Created: 06/Mar/08 08:44 AM   Updated: 13/Jan/09 01:54 AM
Component/s: General, Installation
Affects Version/s: 1.9
Fix Version/s: 2.0

Participants: Eloy Lafuente (stronk7), Matt Clarkson and Petr Škoda (skodak)
Security Level: None
Resolved date: 13/Jan/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
The new hook in 1.9 that allows a module to do some stuff post db install is awesome. However it would be more useful if the call was done later in the install process, once the site course is set-up.

Doing the call post site course set-up would allow module to make role overrides and on the site course and other such things and would basically maximise the usefulness of the hook.

I know nothing in core is using the hook, so unless there's a contrib module relying on the call it should be safe to move without breaking anything.

Any feedback is welcome.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) added a comment - 06/Mar/08 10:01 AM
Just thinking about one alternative hook that could produce the same behaviour in your case (generating one module-instance after site course is created) and also could be used for other courses (not only site).

What about to add two new hooks to modules, say:

newmodule_after_course_creation($course)

newmodule_before_course_deletion($course)

(I've added both just to have them balanced, you can safely ignore the 2nd one)

The cause for this alternative, is that I really think the current newmodule_install() and newmodule_uninstall() are being executed in the correct place now. And moving them after site creation sounds really too much specific for me (while the proposal above sounds more general).

Also, I think we should start introducing the "after/before" or "post/pre" nomenclature to all hooks (plus documenting them) ASAP. It really helps understanding when they are executed.

Just my opinion. Also... suggesting this for 1.9.1... MD has the last word. Ciao


Matt Clarkson added a comment - 06/Mar/08 10:15 AM
Adding an extra call works for me - there can never be too many hooks IMHO

I would like to see it in 1.9.1 also.


Petr Škoda (skodak) added a comment - 13/Jan/09 01:54 AM
site and default category is now created right after the installation of core, before any plugins

thanks for the report