The form required to work in both directions (RTL , LTR), according to some configurations. So if the user chooses to display the form in RTL, the alignment of the input controls must to change to "right" and so the direction should change to RTL, quite simple..
For some reason, the developer that added this functionality did adjust the alignment but did not adjust the direction of the table. This can make the user get confused because he expects the input sequence to be from right to left in case the form is right-aligned.
He solved this problem by changing the logic of reading and saving user input to reverse data in case of RTL. And problems started.
Being a relatively complex module, this change in logic caused other errors that were hard to trace. I solved this bug simply by removing any special handling to RTL case in application logic and changed the direction of the table that contains the drop down list to RTL. This solved the problem and made the code clearer.
I'm fond of thinking about and studying the real causes of bugs and issues. One of them is what the fellow developer did...
The RTL behavior is clearly a UI function. Supporting this functionality should not go to other layers or places in the code.
A new lesson I must remember:
Solve problems where they exist, don't forward them...
Should I say whenever possible?