Fixed issue when creating an image element
The images were not loading in the filemanager. This meant that when the element was saved the images would be deleted for that course, affecting existing image elements as well.
This commit is contained in:
parent
136292f331
commit
9413d65ee0
9 changed files with 32 additions and 19 deletions
|
@ -160,9 +160,11 @@ class customcert_element_date extends customcert_element_base {
|
|||
*/
|
||||
public function definition_after_data($mform) {
|
||||
// Set the item and format for this element.
|
||||
$dateinfo = json_decode($this->element->data);
|
||||
$this->element->dateitem = $dateinfo->dateitem;
|
||||
$this->element->dateformat = $dateinfo->dateformat;
|
||||
if (!empty($this->element->data)) {
|
||||
$dateinfo = json_decode($this->element->data);
|
||||
$this->element->dateitem = $dateinfo->dateitem;
|
||||
$this->element->dateformat = $dateinfo->dateformat;
|
||||
}
|
||||
|
||||
parent::definition_after_data($mform);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue