Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions uc_product/tests/uc_product.test
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ class UbercartProductTestCase extends UbercartTestHelper {

// Check invalid quantity messages.
$this->backdropPost('node/' . $this->product->nid, array('qty' => 'x'), 'Add to cart');
$this->assertText('The quantity must be an integer.');
$this->assertText('The quantity must be zero or a positive whole number.');

$this->backdropPost('node/' . $this->product->nid, array('qty' => '1a'), 'Add to cart');
$this->assertText('The quantity must be an integer.');
$this->assertText('The quantity must be zero or a positive whole number.');

// Check cart add message.
$this->backdropPost('node/' . $this->product->nid, array('qty' => '1'), 'Add to cart');
Expand Down
2 changes: 1 addition & 1 deletion uc_store/uc_store.module
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ function uc_store_validate_number(&$element, &$form_state) {
*/
function uc_store_validate_uc_quantity(&$element, &$form_state) {
if (!preg_match('/^\d+$/', $element['#value'])) {
form_error($element, t('The quantity must be an integer.'));
form_error($element, t('The quantity must be zero or a positive whole number.'));
}
elseif (empty($element['#allow_zero']) && !$element['#value']) {
form_error($element, t('The quantity cannot be zero.'));
Expand Down