If using the https://www.drupal.org/project/views_bulk_edit to build Views to edit content in bulk, there's a PHP error when attempting to use the Views-generated UI to edit content that has Content Moderation/Review associated with it:
TypeError: Drupal\localgov_review_date\Entity\ReviewDate::getActiveReviewDate(): Argument #2 ($langcode) must be of type string, null given
If using the https://www.drupal.org/project/views_bulk_edit to build Views to edit content in bulk, there's a PHP error when attempting to use the Views-generated UI to edit content that has Content Moderation/Review associated with it:
This is in https://github.com/localgovdrupal/localgov_workflows/blob/f3082b37ad8e8812a28df321b4f5e12467a0828e/modules/localgov_review_date/src/Plugin/Field/FieldWidget/ReviewDateWidget.php#L66
Solution
Add a fallback 'und' value to the language code:
$langcode = $form_state->get('langcode') ?? 'und';