Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in Course Config, don't claim database settings are defaults #2557

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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