priority_id getting set incorrectly
A modification in CRM/Member/BAO/Membership.php made in 4.7.20 is causing a db constraint error when attempting to make payment on a membership. (See https://github.com/civicrm/civicrm-core/commit/66a1e31f279137676e395ce60eda2cc14bcde5f1#diff-f43c8498e32f5b2d68ab27bcd243ca36)
The specific modification (in multiple places) is to set the value of 'priority_id' to 'Normal'. It previously was set to 2. My guess is that 'Normal' should be looked up in option_values with the value saved to priority_id.