Skip to content

Commit

Permalink
Merge pull request #3435 from 10up/fix/undefined-array
Browse files Browse the repository at this point in the history
Fix: Undefined array key 'index'
  • Loading branch information
felipeelia authored Apr 6, 2023
2 parents c3754b2 + 092013c commit ff3451b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/classes/IndexHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ protected function output_index_errors( $failed_objects ) {
$error_text = [];

foreach ( $failed_objects as $object ) {
$error_text[] = $object['index']['_id'] . ' (' . $indexable->labels['singular'] . '): [' . $object['index']['error']['type'] . '] ' . $object['index']['error']['reason'];
$error_text[] = ! empty( $object['index'] ) ? $object['index']['_id'] . ' (' . $indexable->labels['singular'] . '): [' . $object['index']['error']['type'] . '] ' . $object['index']['error']['reason'] : (string) $object;
}

return $error_text;
Expand Down

0 comments on commit ff3451b

Please sign in to comment.