Moodle

New switchrole matrix and remove the role assign requirement only in HEAD

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Roles / Access
  • Labels:
    None
  • Difficulty:
    Difficult
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Following the MDL-11313 (see Petr comments 15/Aug/08 06:42 PM), a new switchrole matrix need to be implemented in Moodle 2.0. Use this new switchrole matric for the the Switch Role option.

Issue Links

Activity

Hide
Tim Hunt added a comment -

Note, the changes in MDL-11313 have not been merged to HEAD.

Show
Tim Hunt added a comment - Note, the changes in MDL-11313 have not been merged to HEAD.
Hide
Petr Škoda (skodak) added a comment -

also please unset the new 1.9.x setting during upgrade to 2.0dev

Show
Petr Škoda (skodak) added a comment - also please unset the new 1.9.x setting during upgrade to 2.0dev
Hide
Tim Hunt added a comment -

Done.

Show
Tim Hunt added a comment - Done.
Hide
Eloy Lafuente (stronk7) added a comment -

Oh, oh... reopening.

just got this sentence:

$DB->execute('INSERT INTO {role_allow_switch} SELECT * FROM {role_allow_assign}');

breaking badly in MSSQL. We cannot "move" ids from one table to the other at all. Isn't cross-db: MSSQL breaks because the "autonumeric" fields cannot be specified at all. Plus Oracle (and perhaps Postgres) sequences can end out of sync!

If the "id" isn't important... then you can specify the list ok fields in the select (omitting the id). If it's important... then we have a problem, because dependencies will need to be remapped.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Oh, oh... reopening. just got this sentence: $DB->execute('INSERT INTO {role_allow_switch} SELECT * FROM {role_allow_assign}'); breaking badly in MSSQL. We cannot "move" ids from one table to the other at all. Isn't cross-db: MSSQL breaks because the "autonumeric" fields cannot be specified at all. Plus Oracle (and perhaps Postgres) sequences can end out of sync! If the "id" isn't important... then you can specify the list ok fields in the select (omitting the id). If it's important... then we have a problem, because dependencies will need to be remapped. Ciao
Hide
Tim Hunt added a comment -

Id is not important here, but it will be in the work I am about to do relating to blocks.

There must be a way to do this.

Show
Tim Hunt added a comment - Id is not important here, but it will be in the work I am about to do relating to blocks. There must be a way to do this.
Hide
Tim Hunt added a comment -

Eloy, please review this and let me know what you think.

See http://msdn.microsoft.com/en-gb/library/ms188059.aspx

I'm afraid I could not resist factoring out some duplicated code while I was doing this.

Show
Tim Hunt added a comment - Eloy, please review this and let me know what you think. See http://msdn.microsoft.com/en-gb/library/ms188059.aspx I'm afraid I could not resist factoring out some duplicated code while I was doing this.
Hide
Tim Hunt added a comment -

Fix committed (hopefully) please re-test when you have a moment Eloy.

Show
Tim Hunt added a comment - Fix committed (hopefully) please re-test when you have a moment Eloy.
Hide
Eloy Lafuente (stronk7) added a comment -

Confirming it upgraded ok under MSSQL (role_allow_switch contains copy of records in role_allow_assign).

So closing this now, thanks!

Note: I've found another problem under MSSQL (text_format/filterlib related): MDL-19000 (nice number BTW!

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Confirming it upgraded ok under MSSQL (role_allow_switch contains copy of records in role_allow_assign). So closing this now, thanks! Note: I've found another problem under MSSQL (text_format/filterlib related): MDL-19000 (nice number BTW! Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

BTW... I forgot to comment that like the check_table_exists() refactor... going to apply it. Thanks Tim!

Show
Eloy Lafuente (stronk7) added a comment - BTW... I forgot to comment that like the check_table_exists() refactor... going to apply it. Thanks Tim!
Hide
Tim Hunt added a comment -

Thanks. (After you had rejected my beautiful patch , I was not in the mood to separate that bit out myself.)

Show
Tim Hunt added a comment - Thanks. (After you had rejected my beautiful patch , I was not in the mood to separate that bit out myself.)

People

Dates

  • Created:
    Updated:
    Resolved: