Importing leap2A file does not respect the locked fields rules

Bug #1747795 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned

Bug Description

In the institution settings we can lock profile fields, eg firstname, lastname so that a user can't change the values of them.

However, if we upload a Leap2A file with profile details in them that are different to the current ones we can save the new info to our profile - ignoring the 'lock' on the fields

The import should respect the lock

Changed in mahara:
status: New → Confirmed
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/8545

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Steven (stevens-q) wrote :

I ran the following Behat test manually

Environment tested: Master
Browser tested: Chrome

===================
Behat Test Script
===================

@javascript @core @core_institution @core_artefact
Feature: Leap2a import locks
    As an Institution admin
    I want to lock fields
    So that institution fields will not change when users upload Leap2a portfolios

Background:
Given the following "institutions" exist:
    | name | displayname | registerallowed | registerconfirm |
    | InstA | Institution A | ON | OFF |

And the following "FionaFang.xml" file exist

And the following "institution_locked_profile_field" exist
    | name | locked |
    | firstname | on |
    | student ID | on |

And the following "users" exist:
    | username | password | email | firstname | lastname | institution | authname | role |
    | UserA | Kupuhipa1 | <email address hidden> | Angela | User | Institution A | internal | member |

Scenario: user imports Leap2a file but some fields are locked
    Given I log in as "UserA" with password "Kupuhipa1"
    And I am on "/import/index.php"
    When I attach the file "UserA.xml" to "Upload Leap2A file"
    And I click on "Import"
    Then I should see "Choose the way to import your portfolio items"
    When I expand "About me" node
    Then I should see "Ignore" in the block "First name"
    And I should see "Ignore" in the block "student ID"
    And I should see "Ignore" in the block "Last name"
    And I should see "Replace" in the block "Last name"
    And I should see "Append" in the block "Last name"
    And I should see "Ignore" in the block "Display name"
    And I should see "Replace" in the block "Display name"
    And I should see "Append" in the block "Display name"

Catalyst QA Approved ✔

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

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

commit b10a43b6bd80f9714a95b38c6132177905858c19
Author: Robert Lyon <email address hidden>
Date: Tue Feb 27 12:18:23 2018 +1300

Bug 1747795: Set the import option to 'ignore' for locked profile fields

When doing self import the locked fields will only show 'ignore' radio
button option

behatnotneeded

Change-Id: I9cda4a367a3850b3924405c6735117404ecaa8ea
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
tags: added: usermanualupdate
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.