MPs have backed a change in the law, but the measure still faces many hurdles before coming into force.