Using 7.x-1.2, when visiting /admin/commerce/orders/%id/payment, I get the following warning:

Notice: Undefined property: stdClass::$roles in user_access() (line 803 of .../modules/user/user.module).

I'm attempting to update the payment details for an order paid using the 'Commerce Cheque' payment method.

CommentFileSizeAuthor
#6 commerce_cheque.patch9.87 KB_paul

Comments

jthorson’s picture

Project: Commerce Core » Commerce Cheque
Version: 7.x-1.2 » 7.x-1.x-dev
Component: Checkout » Documentation

Looks like the commerce_payment_transaction call on line 83 is passing the wrong parameters.

commerce_payment_transaction_access('update', $order, $transaction)

Where commerce is expecting:

function commerce_payment_transaction_access($op, $transaction, $account = NULL)

Thus, $order is getting passed into $transaction, and $transaction is getting passed into $account.

Without digging too deep into it, removing $order from the call seems to solve the problem ... but because I didn't dig too deep, who knows what it might be breaking. ;)

guillaumev’s picture

Status: Active » Fixed

Committed a fix, I don't think there was a need to dig deeper, the function call was just wrong (I think I got confused with commerce_payment_transaction_order_access). Thanks !

Status: Fixed » Closed (fixed)

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

rfay’s picture

Status: Closed (fixed) » Fixed

Please do make a release for this. Marked #1431614: Workflow for cash receipt missing "cash" option for anonymous checkout as a duplicate, but it would be better not to have had to chase that.

Status: Fixed » Closed (fixed)

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

_paul’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new9.87 KB

I know that this is an old issue, but here's a patch for the users that will experience this problem.

jthorson’s picture

Status: Needs review » Fixed

_paul,

As per the comment in #2, I think the fix has already been committed to HEAD for the project.

Also, it looks like your patch has bit of extra noise in the headers ... did you use the -p1 format?

_paul’s picture

When I'm downloading the 7.x-1.0 zip file, into the commerce_cheque module I got on line 65 the following line :

  return commerce_payment_transaction_access('update', $order, $transaction);

So I don't know why, but downloading this module and installing it for a Drupal Commerce website, I find this closed issue even if I needed to make the changes you provided on comment #1.

So for the users of this really useful module, and in my own process for learning how to became a contributor, I write my first patch here. Thanks for the review, I will try to configure my IDE (PHPStorm) to submit more qualitative patches.

jthorson’s picture

_paul,

HEAD refers to the latest release (which is typically the 'dev' version). So the 7.x-1.x-dev zip file should include the fix.

Releases (which end in a number) represent the code at a given point in time, so they don't change once created. Fixes are added to the -dev versions until the next release is created ... so the fix is in 7.x-1.x-dev, and will be in 7.x-1.1 once created.

I haven't used PHPStorm personally, but have heard stories that it's great for everything ... except patch creation. The couple I talked to still use git command line in order to generate their patches. That's not saying it isn't possible to configure the IDE (and I don't really know), but there is a fair bit of documentation on drupal.org for the command line process.

Above all, thanks for taking the initiative to submit a patch in the first place! Don't let my comments discourage you, I was in the same position just over a year ago. Stick with it, and don't be afraid to ask questions ... the community is more than willing to help new contributors!

_paul’s picture

You're welcome,

I take no offense, I really want to contribute to an open-source software community I have the feeling that Drupal is the one that I was looking for.

The Commerce Cheque module is a perfect module for me to learn, because it's a really effective but quite simple module. A lot of Drupal Commerce need this - me at the first place - and this is a perfect reason, as a user and a wanna-be contributor, to give my small amount of free time for this module.

So, I'm not discouraged, but encouraged by your comment, and that's why I've open an other issue.

Thanks a lot for your explanation on the commit system, it was perfect (I thought that the latest fix were present into the latest dev code, so your explanation was very valuable to me) !

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.