openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
145 stars 165 forks source link

Fix a useless defined check when searching for email recipients. #2407

Closed drgrice1 closed 5 months ago

drgrice1 commented 5 months ago

Checking that the $sender->section is defined does not work. That method always returns something that is defined. Even if the value of the section is NULL in the database the $sender->section method returns the empty string. Furthermore, testing for section = '' does not work to return those for which the section is NULL in the database. As a result if feedback_by_section is enabled and the $sender does not have a section set, then the returned list will always be empty.

This is a minor issue since typically when feedback_by_section is enabled, the users sending emails will have sections (since that is the whole point). But the defined check is useless.