Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.3, 2.0
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      15486

      Description

      Part of the problem with local/db/upgrade.php on a new install, is that it happens before the site is created. So if you want to do things like ... assign local caps to roles at SITE context, for example, you can't. I wrote a patch for admin/index.php to do a local_postinst to get around this. Not sure if it should go into upstream since I think Petr is looking at rewriting this for 2.0 anyway. Maybe we can have the hook in admin/index.php anyway in 1.9.x until that happens.

        Activity

        Hide
        Petr Škoda added a comment -

        see MDL-17457 , I am thinking about major changes in this area

        Show
        Petr Škoda added a comment - see MDL-17457 , I am thinking about major changes in this area
        Hide
        Penny Leach added a comment -

        I'm thinking maybe this should be done with an instant event, although then it wouldn't be on a page by itself. the patch I had for this sets a session variable after it inserts the site course and then at the end of the normal installation looks for a local_postinst function and runs it, and then redirects again.

        Using an event seems cleaner, but the question is when to do it - it must be after the site and the admin user are installed (because in my local postinst that i wrote this for I do stuff that needs site context )

        Show
        Penny Leach added a comment - I'm thinking maybe this should be done with an instant event, although then it wouldn't be on a page by itself. the patch I had for this sets a session variable after it inserts the site course and then at the end of the normal installation looks for a local_postinst function and runs it, and then redirects again. Using an event seems cleaner, but the question is when to do it - it must be after the site and the admin user are installed (because in my local postinst that i wrote this for I do stuff that needs site context )
        Hide
        Petr Škoda added a comment -

        session is not an option here I think, I am going to ask MD again after xmas because I think that we need some bigger refactoring in install/upgrade/settings area

        Show
        Petr Škoda added a comment - session is not an option here I think, I am going to ask MD again after xmas because I think that we need some bigger refactoring in install/upgrade/settings area
        Hide
        Penny Leach added a comment -

        Agree. I just had a quick 'get something working' hack. More use of events is better I think.

        Show
        Penny Leach added a comment - Agree. I just had a quick 'get something working' hack. More use of events is better I think.
        Hide
        Penny Leach added a comment -

        Closing wontfix - there should be much better work in this area before 2.0 anyway, so not worth it now.

        Show
        Penny Leach added a comment - Closing wontfix - there should be much better work in this area before 2.0 anyway, so not worth it now.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: