Skip to content

WR455936: Group submissions#108

Draft
sarahjcotton wants to merge 2 commits intocatalyst:MOODLE_405_STABLEfrom
sarahjcotton:WR455936-group-submissions
Draft

WR455936: Group submissions#108
sarahjcotton wants to merge 2 commits intocatalyst:MOODLE_405_STABLEfrom
sarahjcotton:WR455936-group-submissions

Conversation

@sarahjcotton
Copy link
Contributor

No description provided.

@sarahjcotton sarahjcotton marked this pull request as draft February 2, 2026 16:31
@sarahjcotton
Copy link
Contributor Author

Hey @danmarsden, any idea why the checks are falling over? Looks like a config issue at the moment, perhaps?

@sarahjcotton sarahjcotton self-assigned this Feb 2, 2026
@danmarsden
Copy link
Member

it's hard to see in the ci output but it's failing to install the plugin - check the output of the install plugin step - it's throwing an error like:

Default exception handler: DDL sql execution error Debug: Key column 'group' doesn't exist in table
    ERR  CREATE TABLE phpu_assignsubmission_maharaws (
    ERR      id BIGINT(10) NOT NULL auto_increment,
    ERR      assignment BIGINT(10) NOT NULL DEFAULT 0,
    ERR      submission BIGINT(10) NOT NULL DEFAULT 0,
    ERR      viewid BIGINT(10) NOT NULL,
    ERR      viewurl LONGTEXT COLLATE utf8mb4_unicode_ci,
    ERR      viewtitle LONGTEXT COLLATE utf8mb4_unicode_ci,
    ERR      iscollection TINYINT(1) NOT NULL DEFAULT 0,
    ERR      viewstatus VARCHAR(20) COLLATE utf8mb4_unicode_ci,
    ERR      groupid BIGINT(10),
    ERR  CONSTRAINT  PRIMARY KEY (id)
    ERR  , KEY phpu_assimaha_ass_ix (assignment)
    ERR  , KEY phpu_assimaha_sub_ix (submission)
    ERR  , KEY phpu_assimaha_gro_ix (`group`)
    ERR  )
    ERR   ENGINE = InnoDB
    ERR   DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
    ERR   COMMENT='Data for Mahara submission'
    ERR  ;
    ERR  CREATE TABLE phpu_assignsubmission_maharawsgroup (
    ERR      id BIGINT(10) NOT NULL auto_increment,
    ERR      moodlegroup BIGINT(10) NOT NULL,
    ERR      maharagroup BIGINT(10) DEFAULT 0,
    ERR      institution LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL,
    ERR  CONSTRAINT  PRIMARY KEY (id)
    ERR  , KEY phpu_assimaha_moo_ix (moodlegroup)
    ERR  )
    ERR   ENGINE = InnoDB
    ERR   DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
    ERR   COMMENT='Default comment for the table, please edit me'
    ERR  Error code: ddlexecuteerror
    ERR  * line 503 of /public/lib/dml/moodle_database.php: ddl_change_structure_exception thrown
    ERR  * line 346 of /public/lib/dml/moodle_read_replica_trait.php: call to moodle_database->query_end()
    ERR  * line 1189 of /public/lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
    ERR  * line 77 of /public/lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
    ERR  * line 427 of /public/lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
    ERR  * line 372 of /public/lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
    ERR  * line 741 of /public/lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
    ERR  * line 1949 of /public/lib/upgradelib.php: call to upgrade_plugins()
    ERR  * line 451 of /public/lib/installlib.php: call to upgrade_noncore()
    ERR  * line 497 of /public/lib/phpunit/classes/util.php: call to install_cli_database()
    ERR  * line 156 of /public/admin/tool/phpunit/cli/util.php: call to phpunit_util::install_site()
    ERR  
    ERR  
    OUT  !!! DDL sql execution error !!!
    OUT  !! Key column 'group' doesn't exist in table
    OUT  CREATE TABLE phpu_assignsubmission_maharaws (
    OUT      id BIGINT(10) NOT NULL auto_increment,
    OUT      assignment BIGINT(10) NOT NULL DEFAULT 0,
    OUT      submission BIGINT(10) NOT NULL DEFAULT 0,
    OUT      viewid BIGINT(10) NOT NULL,
    OUT      viewurl LONGTEXT COLLATE utf8mb4_unicode_ci,
    OUT      viewtitle LONGTEXT COLLATE utf8mb4_unicode_ci,
    OUT      iscollection TINYINT(1) NOT NULL DEFAULT 0,
    OUT      viewstatus VARCHAR(20) COLLATE utf8mb4_unicode_ci,
    OUT      groupid BIGINT(10),
    OUT  CONSTRAINT  PRIMARY KEY (id)
    OUT  , KEY phpu_assimaha_ass_ix (assignment)
    OUT  , KEY phpu_assimaha_sub_ix (submission)
    OUT  , KEY phpu_assimaha_gro_ix (`group`)
    OUT  )
    OUT   ENGINE = InnoDB
    OUT   DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
    OUT   COMMENT='Data for Mahara submission'
    OUT  ;
    OUT  CREATE TABLE phpu_assignsubmission_maharawsgroup (
    OUT      id BIGINT(10) NOT NULL auto_increment,
    OUT      moodlegroup BIGINT(10) NOT NULL,
    OUT      maharagroup BIGINT(10) DEFAULT 0,
    OUT      institution LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL,
    OUT  CONSTRAINT  PRIMARY KEY (id)
    OUT  , KEY phpu_assimaha_moo_ix (moodlegroup)
    OUT  )
    OUT   ENGINE = InnoDB
    OUT   DEFAULT COLLATE = utf8mb4_unicode_ci ROW_FORMAT=Compressed
    OUT   COMMENT='Default comment for the table, please edit me'
    OUT  Error code: ddlexecuteerror !!
    OUT  !! Stack trace: * line 503 of /public/lib/dml/moodle_database.php: ddl_change_structure_exception thrown
    OUT  * line 346 of /public/lib/dml/moodle_read_replica_trait.php: call to moodle_database->query_end()
    OUT  * line 1189 of /public/lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
    OUT  * line 77 of /public/lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
    OUT  * line 427 of /public/lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
    OUT  * line 372 of /public/lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
    OUT  * line 741 of /public/lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
    OUT  * line 1949 of /public/lib/upgradelib.php: call to upgrade_plugins()
    OUT  * line 451 of /public/lib/installlib.php: call to upgrade_noncore()
    OUT  * line 497 of /public/lib/phpunit/classes/util.php: call to install_cli_database()
    OUT  * line 156 of /public/admin/tool/phpunit/cli/util.php: call to phpunit_util::install_site()
    OUT   !!
    OUT  
    RES  1 Command did not run successfully
  

@sarahjcotton sarahjcotton force-pushed the WR455936-group-submissions branch from 8a6b12e to ee05293 Compare February 4, 2026 10:58
@sarahjcotton
Copy link
Contributor Author

Thanks, Dan.

You're right, it's a bit difficult to find the output, but I can see where it is now, so hopefully I should be able to find what I need next time!

Will work on a fix.

WR455936: PR fixes
@sarahjcotton sarahjcotton force-pushed the WR455936-group-submissions branch 12 times, most recently from 59be446 to b3fbbfe Compare February 5, 2026 16:30
@danmarsden
Copy link
Member

haven't had a good look at the patch (haven't got time) - but the change to the new helper::get_config_defaults doesn't look right.

it makes a lot of sense for this to be refactored - but the new logic implemented doesn't match the previous logic.

@sarahjcotton sarahjcotton force-pushed the WR455936-group-submissions branch 4 times, most recently from b2c0700 to a2dbed9 Compare February 12, 2026 11:34
@sarahjcotton sarahjcotton force-pushed the WR455936-group-submissions branch from a2dbed9 to 21895e1 Compare February 12, 2026 11:55
@sarahjcotton
Copy link
Contributor Author

haven't had a good look at the patch (haven't got time) - but the change to the new helper::get_config_defaults doesn't look right.

it makes a lot of sense for this to be refactored - but the new logic implemented doesn't match the previous logic.

The old logic took in one config name and returned the value, but the following settings can be customised in an assignment:

  • url
  • key
  • secret
  • institution

So the new logic returns the full set of plugin config settings with overrides if needed.

Get the global config > If global config is enforced, we're done, so return that.

If global config is not enforced, see if we have some overrides:
If we have a Mahara group but we don't have an assignment (i.e. we need the config for an adhoc task), get an assignment for the same institution and use the connection details for that. Groups are only created when they're linked to an assignment, so if we have a group there should be an assignment.

If we have an assignment, override the config with the custom assignment config.

If all else fails, default to the global config (if the actual connection fails we should get an error explaining why).

That said, the logic was off, so I've updated it... thanks for the pointer!

We'll be doing full testing next week so will update again then as we're not ready for review yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants