fixed custom fields with more than one placeholder

When using custom fields with more than one placeholder ex. "{studytitle} - {teachername}" it will only fill both fields with the content of {studytitle}, because for the second field getElementnumber() will not be called as $rowid has been overwritten (see line 47).

By reading that field at the beginning of the method, we are sure nothing is overwritten.