The fatal error is caused by $options being an object instead of an array at least some of the time.
A possible fix would be to cast it to an array before using it. ie.
$options = (array) $options;
$o->extra_sourc->$name = JText::_($options[$extra_sourc->$name]);
Without seeing the internal structure of things it is difficult to guess anything ...