department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
99 stars 68 forks source link

Days of the week on hours for Facility service locations sometimes say "and" on Node:View #18833

Open laflannery opened 2 months ago

laflannery commented 2 months ago

Description

While reviewing VBA content for approval and go live, Michelle discovered an bug within the Hours section on the service location paragraph.

Sometimes, though we haven't yet been able to determine a pattern, the day of the week doesn't show on the view screen, instead the word "and" displays.

Examples

image

Second location has "and" on Thursday ![image](https://github.com/user-attachments/assets/91ba0cc9-f133-41d9-bd02-540d3fa51fa9)
Third - Ninth locations looks good (didn't screenshot them all) ![image](https://github.com/user-attachments/assets/e7a03733-e3bb-4b59-bdf6-559253330259)
Tenth location has "and" for Thursday ![image](https://github.com/user-attachments/assets/87020a17-9c23-4149-a04b-430b0f5dd308)

Additional Context

Original slack thread where this was reported

From Christian: The part of the module that generates this: office_hours/src/Plugin/Field/FieldType/OfficeHoursItem.php

public static function formatLabel(string $pattern, array $value, $day_delta = 0) {
    $label = NULL;

    $day = $value['day'];
    switch (TRUE) {
      case ($day_delta):
        // Return fast for a following slot.
        $label = t('and');
        break;

Acceptance Criteria

davidmpickett commented 2 months ago

This bug appears to be limited to Node:View. It doesn't appear on Node:Edit and doesn't get passed through to the Front End