Commit 2b3bf0e7 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Fix profile to delete empty profile fields rather than create empty

artefacts. Patch from Penny but Nigel can't work git-am
parent d3be9d1c
......@@ -132,6 +132,13 @@ class ArtefactTypeProfile extends ArtefactType {
}
}
public function set($field, $value) {
if ($field == 'title' && empty($value)) {
return $this->delete();
}
return parent::set($field, $value);
}
public function render($format, $options) {
if ($format == FORMAT_ARTEFACT_RENDERFULL) {
return $this->title;
......
......@@ -360,6 +360,7 @@ abstract class ArtefactType {
*/
public function delete() {
if (empty($this->id)) {
$this->dirty = false;
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment