[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm

raeburn raeburn at source.lon-capa.org
Sun Dec 14 20:23:05 EST 2025


raeburn		Mon Dec 15 01:23:05 2025 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  - Roles-based conditions for existing Course/Community-based conditional 
    access to a portfolio file can be updated. 
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.272 loncom/interface/portfolio.pm:1.273
--- loncom/interface/portfolio.pm:1.272	Sat Dec 13 05:56:01 2025
+++ loncom/interface/portfolio.pm	Mon Dec 15 01:23:05 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.272 2025/12/13 05:56:01 raeburn Exp $
+# $Id: portfolio.pm,v 1.273 2025/12/15 01:23:05 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1278,6 +1278,9 @@
 	    &Apache::loncommon::get_env_multiple('form.preserve_role_'.$num);
 	if (@delete_role_ids) {
 	    foreach my $id (@preserves) {
+                if (($id ne '') && (grep(/^$id$/, at delete_role_ids)) {
+                    next;
+                }
 		if (grep {$_ = $id} (@delete_role_ids)) {
 		    next;
 		}
@@ -1288,13 +1291,13 @@
 	}
 
 	my $next_id = $env{'form.add_role_'.$num};
-	if ($next_id) {
+	if ($next_id ne '') {
 	    push(@role_ids,$next_id);
 	}
 
         foreach my $id (@role_ids) {
             my (@roles, at accesses, at sections, at groups);
-            if (($id == $next_id) && ($chg eq 'update')) {
+            if (($next_id ne '') && ($id == $next_id) && ($chg eq 'update')) {
                 @roles    = split(/,/,$env{'form.role_'.$num.'_'.$next_id});
                 @accesses = split(/,/,$env{'form.access_'.$num.'_'.$next_id});
                 @sections = split(/,/,$env{'form.section_'.$num.'_'.$next_id});




More information about the LON-CAPA-cvs mailing list