Double up of code that doesn't do anything in editlayout

Bug #1907718 reported by Doris Tam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Doris Tam

Bug Description

Code in get_basic_elements is duplicated in get_advanced_elements

In Mahara, the options are only used in get_advanced_elements. So should be removed in the basic elements area.

$ownerformatoptions = array(
        FORMAT_NAME_FIRSTNAME => sprintf($formatstring, get_string('firstname'), $USER->get('firstname')),
        FORMAT_NAME_LASTNAME => sprintf($formatstring, get_string('lastname'), $USER->get('lastname')),
        FORMAT_NAME_FIRSTNAMELASTNAME => sprintf($formatstring, get_string('fullname'), full_name())
    );

    $displayname = display_name($USER);
    $studentid = (string)get_field('artefact', 'title', 'owner', $USER->get('id'), 'artefacttype', 'studentid');
    if ($displayname !== '') {
        $ownerformatoptions[FORMAT_NAME_DISPLAYNAME] = sprintf($formatstring, get_string('preferredname'), $displayname);
    }

Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 21.04.0
Doris Tam (doristam)
Changed in mahara:
assignee: nobody → Doris Tam (doristam)
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11502

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11502
Committed: https://git.mahara.org/mahara/mahara/commit/75bd9a91b3aed206ab1f4e975a7d57dfe8808755
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 75bd9a91b3aed206ab1f4e975a7d57dfe8808755
Author: Doris Tam <email address hidden>
Date: Thu Dec 17 14:05:40 2020 +1300

Bug 1907718: Removing duplicated unused code in editlayout.php

Format display name options are not used in the basic elements
of the config but in the advanced elements.

Change-Id: I6f4c8dd2a374e767b3b08f697159f69e019f3871

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.