If there is one error outside the checkout panes, it is not displayed. The problem is this line:

$previous_messages['error'] = array_diff($previous_messages['error'], $errors[$pane_id]);

It can return an array not starting from 0:

var_dump(array_diff(array('a','b'), array('a')));
array(1) {
  [1]=>
  string(1) "b"
}

But theme_status_messages expects that the index should start from 0, at least when there is one element. While this could be considered a bug in Drupal core, it's easier to fix in Commerce.

CommentFileSizeAuthor
#1 1945758-commerce-error-messages.patch647 bytesjcisio

Comments

jcisio’s picture

Status: Active » Needs review
StatusFileSize
new647 bytes
rszrama’s picture

Title: Error outside checkout panes is not displayed » Work around theme_status_messages() limitation to display checkout form errors outside panes
Category: bug » task
Status: Needs review » Fixed

Heh, yeah, we can accommodate that, and in core they just need to rekey the array in template_preprocess_status_messages(). I've added a message about that in #1939082: Convert theme_status_messages() to Twig. Welcome to the committers log!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

too many spaces