Fix - New Language added has no weight

I'm sorry I didn't take the time to add a test case to underline my fix.

Prior this fix:
But when you added a new record, the new record has no weight set.

The purpose of my fix is to set a weight to a new record.

This case happened when primaryKey field is set but empty.
(cherry picked from commit c13d1ad3b5a9a8f587a219895dc9889f4093844c)
Add test to underline previous commit
Merge branch 'pr/211' into 1.6