- $template->param(unique_id_disabled => 1);
- if ($attr_type->password_allowed()) {
- $template->param(password_allowed_checked => 1);
- }
- if ($attr_type->opac_display()) {
- $template->param(opac_display_checked => 1);
- }
- if ($attr_type->staff_searchable()) {
- $template->param(staff_searchable_checked => 1);
- }
- if ($attr_type->display_checkout()) {
- $template->param(display_checkout_checked => 'checked="checked"');
- }
- authorised_value_category_list($template, $attr_type->authorised_value_category());
- pa_classes( $template, $attr_type->class );
-
-
- my $branches = GetBranches;
- my @branches_loop;
- my $selected_branches = $attr_type->branches;
- foreach my $branch (sort keys %$branches) {
- my $selected = ( grep {$$_{branchcode} eq $branch} @$selected_branches ) ? 1 : 0;
- push @branches_loop, {
- branchcode => $branches->{$branch}{branchcode},
- branchname => $branches->{$branch}{branchname},
- selected => $selected,
- };
+ my $can_be_set_to_unique = 1;
+ if ( $attr_type->unique_id == 0 ) {
+ $attr_type->unique_id(1);
+ eval {$attr_type->check_unique_ids};
+ $can_be_set_to_unique = 0 if $@;
+ $attr_type->unique_id(0);