Wunderbyte-GmbH / moodle-mod_booking

Moodle Booking Module
https://www.wunderbyte.at
21 stars 40 forks source link

Multiple class issues when removing underscores form strings #589

Closed semteacher closed 3 months ago

semteacher commented 3 months ago

Found multiple class issues when removing underscores form strings. Many times classnames have been used as selectors but they contains underscore in names

Image

I have tried to apply workaround like

Image

but finally I get to the cases like (with rules/campaings):

Image

It is possible to implement same solution

public function get_name_of_condition($localized = true) { return $localized ? get_string(strreplace("", "", $this->conditionname), 'mod_booking') : $this->conditionname; }

will work but it affects code quality. In contrast, full refactoring of all those cases could take significant time and affects other parts of code... And even data stored in DB (json fields primarily)

semteacher commented 3 months ago

Solution provided under https://github.com/Wunderbyte-GmbH/moodle-mod_booking/tree/dev_testing_refactoring_underscore