--- loncom/interface/domainprefs.pm 2025/01/12 16:10:23 1.448 +++ loncom/interface/domainprefs.pm 2025/01/12 16:23:33 1.449 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.448 2025/01/12 16:10:23 raeburn Exp $ +# $Id: domainprefs.pm,v 1.449 2025/01/12 16:23:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -12140,7 +12140,11 @@ sub modifiable_userdata_row { my $hashref; if ($context eq 'lti') { if (ref($settings) eq 'HASH') { - $hashref = $settings->{'instdata'}; + my %instdata; + if (ref($settings->{'instdata'}) eq 'ARRAY') { + map { $instdata{$_} = 1; } @{$settings->{'instdata'}}; + } + $hashref = \%instdata; } } elsif ($context eq 'privacy') { my ($key,$inner) = split(/_/,$role); @@ -16087,9 +16091,9 @@ sub modify_lti { } my @possinstdata = &Apache::loncommon::get_env_multiple('form.lti_instdata_'.$idx); if (@possinstdata) { - foreach my $field (@possinstdata) { + foreach my $field (sort(@possinstdata)) { if (exists($fieldtitles{$field})) { - push(@{$confhash{$itemid}{'instdata'}}); + push(@{$confhash{$itemid}{'instdata'}},$field); } } } @@ -16251,7 +16255,7 @@ sub modify_lti { } } unless ($changes{$itemid}) { - foreach my $field ('makeuser','lcmenu') { + foreach my $field ('makeuser','lcmenu','instdata') { if (ref($currlti{$field}) eq 'ARRAY') { if (ref($confhash{$itemid}{$field}) eq 'ARRAY') { my @diffs = &Apache::loncommon::compare_arrays($currlti{$field}, @@ -16465,8 +16469,10 @@ sub modify_lti { $resulttext .= '
  • '.&mt('Institutional data will be used when creating a new user for: [_1]', join(', ',map { $fieldtitles{$_}; } @{$confhash{$itemid}{'instdata'}})).'
  • '; } else { - $resulttext .= '
  • '.&mt('No institutional data used when creating a new user.').'
  • '; + $resulttext .= '
  • '.&mt('No institutional data used when creating a new user').'
  • '; } + } else { + $resulttext .= '
  • '.&mt('No institutional data used when creating a new user').'
  • '; } foreach my $item ('topmenu','inlinemenu') { $resulttext .= '
  • '.$lt{$item}.': ';