Skip to:
Content

BuddyPress.org

Changeset 10324


Ignore:
Timestamp:
11/03/2015 06:44:28 PM (8 years ago)
Author:
imath
Message:

xProfile Admin UI: make sure profile fields can be reordored and moved from a group of fields to another

In r10071 the fieldset ids has been removed to avoid having duplicate ids into the xProfile admin screen. Unfortunately, to save the state of the draggable fields, we need every xProfile fieldsets to have an id attribute. To have the right behavior back, we are putting back an id attribute to these selectors making sure they are unique by prefixing them with "draggable_".

Fixes #6695

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-admin.php

    r10280 r10324  
    493493    $field_group_id = $_POST['field_group_id'];
    494494
    495     foreach ( (array) $order['field'] as $position => $field_id ) {
     495    foreach ( (array) $order['draggable_field'] as $position => $field_id ) {
    496496        xprofile_update_field_position( (int) $field_id, (int) $position, (int) $field_group_id );
    497497    }
     
    531531    $field = $admin_field; ?>
    532532
    533     <fieldset class="sortable<?php echo ' ' . $field->type; if ( !empty( $class ) ) echo ' ' . $class; ?>">
     533    <fieldset id="draggable_field_<?php echo esc_attr( $field->id ); ?>"class="sortable<?php echo ' ' . $field->type; if ( !empty( $class ) ) echo ' ' . $class; ?>">
    534534        <legend>
    535535            <span>
Note: See TracChangeset for help on using the changeset viewer.