donhinkelman / moodle-block_sharing_cart

Content sharing plug-in for Moodle LMS. Now at version 4.4, release 3 (actually this is for Moodle LMS version 4.3. Requires PHP 7.4.
7 stars 38 forks source link

Issues highlighted by admin/cli/check_database_schema.php (block_sharing_cart_sections) #109

Closed abias closed 1 year ago

abias commented 3 years ago

Every now and then, we are running the admin/cli/check_database_schema.php script in our Moodle installation.

This time, this issue was highlighted:

-------------------------------------------------------------------------------
block_sharing_cart_sections
 * column 'name' should be NOT NULL (C)
-------------------------------------------------------------------------------

Upon investigation, I saw that for upgraded installations, the table was introduced correctly in https://github.com/donhinkelman/moodle-block_sharing_cart/blob/master/db/upgrade.php#L115, but changed later in https://github.com/donhinkelman/moodle-block_sharing_cart/blob/master/db/upgrade.php#L131.

I am not sure / haven't looked deeper at the code, but as the NOTNULL parameter was not set in https://github.com/donhinkelman/moodle-block_sharing_cart/blob/master/db/upgrade.php#L131, this table layout flaw could have sneaked in into upgraded installations.

I have fixed this database table now locally with SQL, but as I expect that it affects more installations than ours, I would like to encourage you to have a look if you should fix this with a new entry in db/upgrade.php.

Thanks in advance, Ale

donhinkelman commented 3 years ago

Thank you, Alex, for the detailed description of the problem. I have assigned Ulrik, who may pass this to another staff who may be aware of this issue.

frederikmillingpytlick commented 1 year ago

This issue has been fixed by @marxjohnson, closing issue