Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
2b3bf0e7
Commit
2b3bf0e7
authored
Jan 20, 2007
by
Nigel McNie
Committed by
Nigel McNie
Jan 20, 2007
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/internal/lib.php
View file @
2b3bf0e7
...
...
@@ -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
;
...
...
htdocs/artefact/lib.php
View file @
2b3bf0e7
...
...
@@ -360,6 +360,7 @@ abstract class ArtefactType {
*/
public
function
delete
()
{
if
(
empty
(
$this
->
id
))
{
$this
->
dirty
=
false
;
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment