1. In administration interface, go to an order page (paid by check).
  2. Click on "Receive Check" link. We are on this URL: http://localhost/drupal/admin/store/orders/{ORDER_NUMBER}/receive_check
  3. Submit the form.
  4. A blank page is displayed (no HTML is returned) and according to Firefox console, "HTTP 500 Internal Server Error" is returned.
  5. http://localhost/drupal/admin/reports/dblog did not log this.
  6. The form is correctly submitted: balance is well edited and an entry in http://localhost/drupal/admin/store/orders/2/payments is added (even if method indicates "other" instead of "check").

Comments

pols12 created an issue. See original summary.

TR’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this at all. Note that we have Simpletest cases which verify that receiving a check works properly, and these run without an error.

"HTTP 500 Internal Server Error" means your server had a problem. This is almost never the result of bad module code - if the module does something wrong (like divide by zero for instance) then the server will NOT generate a 500 error. A 500 error is usually something like out of server memory, which is not in the control of the module.

You should have a message in your server error log saying exactly what the problem was. Please post that message.

(In regards to #6, the text displayed in the payment log is the name of your payment method which you configured at /admin/store/config/payment. You can call your check method anything you want, and that anything will show up in the payment log. I suspect you configured a check method and named it "other" - that's the only way I can see this happening. The Check plugin and Other plugin are completely independent, and the strings "other" and "Other" are not used anywhere in the Check plugin.

pols12’s picture

Sorry, I am a novice. I believed I had posted Apache logged error.

[Sat Aug 13 10:53:30.216754 2016] [:error] [pid 2530] [client 127.0.0.1:53824] PHP Fatal error: Call to a member function getName() on null in /var/www/html/drupal/modules/ubercart/uc_order/src/Entity/Order.php on line 141, referer: http://localhost/drupal/admin/store/orders/2/receive_check

You are right: after too many bugs I finally arrived to reinstall Ubercart. And I don't see the problem any more. So, a non reproducible bug. Sorry for this issue opening.

However, for method displayed, I think it is a real bug:
ReceiveCheckForm.php (line 73):

uc_payment_enter($form_state->getValue('order_id'),
'check', //constant string
$form_state->getValue('amount'), $this->currentUser()->id(), '', $form_state->getValue('comment')); 

uc_payment.module (line 155-156):

function uc_payment_enter($order_id, $method, $amount, $uid = 0, $data = NULL, $comment = '', $received = REQUEST_TIME) {
  [...]
  $method_entity = PaymentMethod::load($method);
  $method_name = $method_entity ? $method_entity->getPlugin()->cartReviewTitle() : t('Other');

It only works if the system name of check payment method is "check". But, as I am French, I have called it "cheque" ("Chèque" as label).

Probably ReceiveCheckForm.php (line 73) should be something like that:

uc_payment_enter($form_state->getValue('order_id'),
$form_state->getValue('payment_method'), //specific string which is defined in the order
$form_state->getValue('amount'), $this->currentUser()->id(), '', $form_state->getValue('comment')); 

No? What do you think? I close this ticket as "cannot reproduce" and I open another one for this second issue?

pols12’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I have opened #2789967.