-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#140: Question UI Renderer soll gelöschte Antworten erkennen #149
base: dev
Are you sure you want to change the base?
Conversation
foreach ($newdoc->documentElement->childNodes as $childnode) { | ||
$imported = $doc->importNode($childnode, deep: true); | ||
if ($imported === false) { | ||
debugging('Could not import HTML node from placeholder value'); | ||
return false; | ||
} | ||
$fragment->appendChild($imported); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ist es ein Problem, dass hier im return false
-Fall Nodes importiert, aber nicht verwendet werden? Wächst dadurch das Dokument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Es ist leider nicht explizit dokumentiert, aber meine naive Vermutung war, dass das Dokument keine Referenz auf das Fragment (und damit transitiv das importierte Element) erhält, bis das Fragment nicht irgendwo hinzugefügt wird. Mit Blick auf den libxml-Code scheint das auch so zu sein.
Das importNode
selbst scheint auch keine direkte Referenz von $doc
auf $imported
zu erstellen. (Nur andersherum, PHP ext-dom, libxml2). Ich sehe also nicht, warum $fragment
nicht nach return false
gelöscht werden sollte.
@@ -49,6 +50,9 @@ | |||
$string['question_package_upload'] = 'Upload your own'; | |||
$string['remove_packages_button'] = 'Remove Packages'; | |||
$string['render_error_section'] = 'An error occurred'; | |||
$string['render_warning_invalid_value'] = 'The last submission set the field {$a->name} to the value {$a->value}, but that option is no longer available. The available options are: {$a->availablevalues}.'; | |||
$string['render_warnings_hint_contact_trainers'] = 'If you believe this to be in error, contact your trainers. They will also see this notice and may decide to override whichever score you receive.'; | |||
$string['render_warnings_hint_editable'] = 'You may set the mentioned field(s) to a valid value, or leave them untouched to preserve the invalid value.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave them untouched to preserve the invalid value
Gilt das auch für checkboxes und radios?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja, durch das hinzugefügte hidden
-Input. Im Falle von required
-Feldern wird vielleicht eine Warnung angezeigt, das sollte ich nochmal eroieren. Aber durch soften_validation
verhindert das ja eh nicht die Submission.
917ef53
to
f72edf5
Compare
…r selects Selects already preserve their value through the added fallback option.
f72edf5
to
f33fda6
Compare
Closes #140