Commit b311c855 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge "Remove confusing message when disabling multiple journals (bug #918571)"

parents 0738714f 5e07db54
......@@ -92,6 +92,9 @@ $elements['accountoptionsdesc'] = array(
// Add general account options
$elements = array_merge($elements, general_account_prefs_form_elements($prefs));
// If the user doesn't have exactly one blog, don't show the multipleblogs option.
$elements['multipleblogs']['ignore'] = count_records('artefact', 'artefacttype', 'blog', 'owner', $USER->get('id')) != 1;
$elements['submit'] = array(
'type' => 'submit',
'value' => get_string('save')
......@@ -143,13 +146,6 @@ function accountprefs_validate(Pieform $form, $values) {
$form->set_error('username', get_string('usernamealreadytaken', 'auth.internal'));
// Don't let users turn multiple blogs off unless they only have 1 blog
if ($USER->get_account_preference('multipleblogs')
&& empty($values['multipleblogs'])
&& count_records('artefact', 'artefacttype', 'blog', 'owner', $USER->get('id')) != 1) {
$form->set_error('multipleblogs', get_string('disablemultipleblogserror', 'account'));
function accountprefs_submit(Pieform $form, $values) {
......@@ -64,7 +64,6 @@ $string['tagssideblockmaxtagsdescription'] = 'Maximum number of tags to display
$string['enablemultipleblogs'] = 'Enable multiple journals';
$string['enablemultipleblogsdescription'] = 'By default, you have one journal. If you would like to keep more than one journal, check this option.';
$string['disablemultipleblogserror'] = 'You cannot disable multiple journals unless you only have one journal';
$string['hiderealname'] = 'Hide real name';
$string['hiderealnamedescription'] = 'Check this box if you have set a display name and you do not want other users to be able to find you by your real name in user searches.';
Markdown is supported
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