Similar to #3472 needed to allow up to 48 extension to be selectable and editable on the device_edit page.
Additionally, fixed sorting issue so line numbers are correctly sorted sequentially (line number is stored as text field so needed to change cast in SQL query).