moodle-an-hochschulen / moodle-theme_boost_campus

Moodle 3.x Boost child theme which is intended to meet the needs of university campuses and adds several features and improvements ––– for Moodle 4.x please use our Theme Boost Union
GNU General Public License v3.0
38 stars 25 forks source link

Check existance of properties before accessing them. #55

Closed lucaboesch closed 5 years ago

lucaboesch commented 5 years ago

Warnings

Undefined property: stdClass::$blockcolumnwidth in [dirroot]/theme/boost_campus/lib.php … Undefined property: stdClass::$blockcolumnwidthdashboard in [dirroot]/theme/boost_campus/lib.php …

kept showing up when running Behat test to a Moodle site using your child theme (actually a child theme of your child theme).

Those changes kept the flow going and resolved the issue. Not sure if it relates directly to it but checking the existance of a property before accessing it is never bad, is it?

Kathrin84 commented 5 years ago

Hi @lucaboesch,

thank you very much for this pull request. This is very much appreciated. As this setting threw this warning, it is okay to check if the variable is set before using it. You just forgot the second closing brackets and I was so free to add them for you. Your code is merged into the master branch and will be released with the next version in the Moodle's plugins repository. 👍

Thank you very much for your help! Best, Kathrin