Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-1534

FITS metadata display adds multiple identical values for field

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.x-1.5, 7.x-1.6
    • Fix Version/s: 7.x-1.7
    • Component/s: FITS module
    • Labels:
      None

      Description

      When building the output array in islandora_fits_children(), the function loops through the tool/field/values in the recursed xml, and is supposed to be testing to see if there are any identical values previously existing in the array at $output[$tool_label][$field_label]. If so, it's supposed to skip adding the new value.

      However, the code does not do this. It loops through the existing values at that tool/field, and if *any* of them do not match the current value, it will add the current value:
      foreach ($output[$tool_label][$field_label] as $key => $value) {
      if ($value !== $output_text)

      { $output[$tool_label][$field_label][] = $output_text; }

      }
      I think a more correct approach would be something like the following:
      if (!in_array($output_text, $output[$tool_label][$field_label]))

      { $output[$tool_label][$field_label][] = $output_text; }

        Attachments

          Activity

            People

            • Assignee:
              nruest Nick Ruest
              Reporter:
              patdunlavey Patrick Dunlavey
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: