Needs review
Project:
Pay
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2012 at 06:35 UTC
Updated:
5 Mar 2013 at 06:49 UTC
Jump to comment: Most recent file
Hi, I just made a view and the "view link" for transactions appear not be working. I also discovered that the menu path for view a transaction throw a http error 500.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | pay_transaction_view-1868200.patch | 2.58 KB | quicksketch |
| #6 | pay_transaction_view-1868200.patch | 3.29 KB | quicksketch |
| #5 | pay_transaction_view-1868200.patch | 2.54 KB | quicksketch |
| #2 | pay_transaction_theme_fixes.patch | 3.36 KB | gdoteof |
Comments
Comment #1
gdoteof commentedI am having this same problem.
The issue is that in pay's implementation of hook_menu it defines the call back like
and theme() expects an array.
Comment #2
gdoteof commentedThis patch should solve this issue.
We add a helper function to convert the pay_transaction object into an array for theme.
We also manually load the pay_transaction in the preprocessor.
There is a small typo fix
And, $pay_transaction->balance() was causing a 500, and since I am not using balance at this point, I just commented the column out from the table display.
Comment #3
gdoteof commentedComment #4
quicksketch@gdoteof is right that the use of 'theme' directly in the menu callback needs to be changed. In D7, all theme functions need to be formatted as an array, so we can't just use hook_menu() directly to theme() like this any more.
This patch gets the basics set up, but this call isn't quite right. The calls to theme() need to use named keys, such as
theme('something', array('key' => $value)). This code is using an unnamed key, liketheme('something', array(0 => $value)). This may also be why$activity->balance()is throwing a new 500 error, because $activity may not be getting the values it needs.Comment #5
quicksketchHere we are. This patch corrects the call to theme('pay_transaction') and additionally fixes a call to theme('links') that was causing a bunch of notices when viewing a pay transaction. You can now view a payment at the URL "pay/transaction/pay/x" without it throwing any errors or notices.
Comment #6
quicksketchOops, still didn't get the call to theme('links') quite right. And classes should always be an array in D7 (even though strings work some of the time).
Comment #7
quicksketchDoh, and I included the JS fix *again*. I need to make a separate issue for that problem.