D7 version has been upstreamed from D6 version changes. Currently un-tested, but I think (and hope) i ported the code correctly.
Problems may persist due to issues with field widgets not dealing well with #access FALSE. If this issue is unable to get resolved, we may choose to simple CSS hide the fields.