Skip to content

Commit

Permalink
Merge pull request openwebwork#2562 from Alex-Jordan/hotfix/config-de…
Browse files Browse the repository at this point in the history
…faults

in Course Config, don't claim database settings are defaults (hotfix for openwebwork#2557)
  • Loading branch information
drgrice1 authored Sep 3, 2024
2 parents 12c2965 + 46c578c commit 647d317
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/WeBWorK/ConfigObject/setting.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ use Mojo::Base 'WeBWorK::ConfigObject', -signatures;

# Configure settings in the course's setting table.

sub get_value ($self, $ce) { return $self->{c}->db->getSettingValue($self->{var}) // '' }
sub get_value ($self, $ce) {
# If the course name of the controller's course environment is the same as the passed course environment, then
# return the value from the database. Otherwise this is the default site wide setting. So return the empty string
# (there is no default).
return $self->{c}->ce->{courseName} eq $ce->{courseName}
? ($self->{c}->db->getSettingValue($self->{var}) // '')
: '';
}

# This actually changes a database value, and so must return the empty string
# so that it is not represented in the course's simple.conf file.
Expand Down

0 comments on commit 647d317

Please sign in to comment.