Moodle

assignment_submissions->data1 and data2 are NOT NULL

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.2, 1.8.2, 1.9
  • Fix Version/s: 1.7.3, 1.8.3, 1.9
  • Component/s: Assignment
  • Labels:
    None
  • Environment:
    any
  • Database:
    Any
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Both assignment_submission->data1 and data2 are declared as NOT NULL.

This, obviously, means that, for each record, one meaningful value must be provided for both them. But it seems that, we are fulfilling them with:

1) empty values under normal grading (online assignments, for example).
2) NULL values under quick grading, because there is one insert where those fields are not set.

So, I will do one of this:

1) OR change both fields to nullable stopping them to default to empty where they are currently defaulting to empty.
2) OR leave both fields as not null, adding their empty values in the quick grading.

Final note: Only tested under 1.9 but I guess the same problem is there in older branches.
Sincerely, I think that, if the fields haven't a meaningful default and that, in fact, they can be empty, then 1) above is the correct solution and both fields should be redefined as NULLable.

Ciao

Activity

Hide
Petr Škoda (skodak) added a comment -

my +1

Show
Petr Škoda (skodak) added a comment - my +1
Hide
Eloy Lafuente (stronk7) added a comment -

Oki. Going to:

a)- Fix the quick grading submission by adding empty values to data1 and data2 (17_STABLE and 18_STABLE).
b)- Change fields to NULLable under HEAD.

Please, final approve for b) required!!

Show
Eloy Lafuente (stronk7) added a comment - Oki. Going to: a)- Fix the quick grading submission by adding empty values to data1 and data2 (17_STABLE and 18_STABLE). b)- Change fields to NULLable under HEAD. Please, final approve for b) required!!
Hide
Eloy Lafuente (stronk7) added a comment -

a) Implemented under 17_STABLE and 18_STABLE

So, for HEAD....

1) apply the same patch (leaving fields as NOT NULL).
2) change fields to NULL.

waiting until clarified....ciao

Show
Eloy Lafuente (stronk7) added a comment - a) Implemented under 17_STABLE and 18_STABLE So, for HEAD.... 1) apply the same patch (leaving fields as NOT NULL). 2) change fields to NULL. waiting until clarified....ciao
Hide
Martin Dougiamas added a comment -

for HEAD let's do 2) +1

Show
Martin Dougiamas added a comment - for HEAD let's do 2) +1
Hide
Eloy Lafuente (stronk7) added a comment -

Done. Since now data1 & data2 are nullable in HEAD. Closing.

Show
Eloy Lafuente (stronk7) added a comment - Done. Since now data1 & data2 are nullable in HEAD. Closing.

People

Dates

  • Created:
    Updated:
    Resolved: