Hi,
The bug can be seen when editing any existing document with a Template Variable of type URL. The selected value (http://, ftp://, etc.) is incorrectly set on the edit page which causes the document to be saved with this incorrect value (if the value is not changed). The saved value would in all cases be "$v". I traced it back to the following error in the PHP code:
<?php
$field_html.='<option value="$v" selected="selected">'.$k.'</option>';
?>
This line should ofcourse be:
<?php
$field_html.='<option value="'.$v.'" selected="selected">'.$k.'</option>';
?>
In both code snippets, the <?php and ?> tags are just for code coloring and are not present in the actual code.
Hope this helps.