Instead of using the form alter hook to edit the contextual filter, you can delete/omit the contextual filter, add a regular exposed filter (in my case, it was based on the field "year") and used the form alter hook to manipulate that. Not sure why the original tutorial had us creating a contextual filter, because editing the already available field (date) filter worked just fine.
Here's a part of the code you would use as a replacement...
....
$options[''] = new TranslatableMarkup('- All -');
...
Instead of using the form alter hook to edit the contextual filter, you can delete/omit the contextual filter, add a regular exposed filter (in my case, it was based on the field "year") and used the form alter hook to manipulate that. Not sure why the original tutorial had us creating a contextual filter, because editing the already available field (date) filter worked just fine.
Here's a part of the code you would use as a replacement...
....
$options[''] = new TranslatableMarkup('- All -');
...
$default_year = $form_state->getUserInput()['field_year_value'];
$form['field_year_value'] = [
'#title' => new TranslatableMarkup('By year'),
'#type' => 'select',
'#options' => $options,
'#size' => NULL,
'#default_value' => '',
'#value' => $default_year,
];