|
|
| Participants: |
Olli Savolainen and Tim Hunt
|
| Security Level: |
None
|
| Difficulty: |
Moderate
|
| Resolved date: |
26/Nov/08
|
| Affected Branches: |
MOODLE_20_STABLE
|
| Fixed Branches: |
MOODLE_20_STABLE
|
|
//TODO: Tim? why does the above evaluate true, breaking the form?
// and more importantly, if this is a valid situation, how should we react,
// that is, what does this mean?
//$mform->hardFreeze('parent');
"By the way, the purpose of the code
if (1 == $DB->count_records_sql("SELECT count(*)
FROM {question_categories} c1,
{question_categories} c2
WHERE c2.id = ?
AND c1.contextid = c2.contextid", array($currentcat))){
$mform->hardFreeze('parent');
}
Well, the SQL is counting the number of other categories belonging to the same context as this one. If there is only one, then it is trying to stop you changing the parent (so you can't remove the default category from any context.) However, that should not apply when you are creating a new context. (That applies to the standard create category form too.) Can you either fix this, or create a new issues assigned to me."
If the check does not apply, perhaps remove it, or debug the reason behind it?
|
|
Description
|
//TODO: Tim? why does the above evaluate true, breaking the form?
// and more importantly, if this is a valid situation, how should we react,
// that is, what does this mean?
//$mform->hardFreeze('parent');
"By the way, the purpose of the code
if (1 == $DB->count_records_sql("SELECT count(*)
FROM {question_categories} c1,
{question_categories} c2
WHERE c2.id = ?
AND c1.contextid = c2.contextid", array($currentcat))){
$mform->hardFreeze('parent');
}
Well, the SQL is counting the number of other categories belonging to the same context as this one. If there is only one, then it is trying to stop you changing the parent (so you can't remove the default category from any context.) However, that should not apply when you are creating a new context. (That applies to the standard create category form too.) Can you either fix this, or create a new issues assigned to me."
If the check does not apply, perhaps remove it, or debug the reason behind it? |
Show » |
tjhunt committed 2 files to 'Moodle CVS' - 26/Nov/08 01:25 PM
MDL-17361 Problems with the question category editing forms.
When editing an existing category, the logic should have been to prevent you from moving the category if it was the last remaining top-level category in its context.
When creating a new category as part of creating a random question, there should be no restriction.
|
|
|
made changes - 26/Nov/08 01:25 PM
| Field |
Original Value |
New Value |
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
|
Resolution
|
|
Fixed
[ 1
]
|
|