Closed (fixed)
Project:
Payment
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2013 at 20:38 UTC
Updated:
9 May 2013 at 21:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
pbuyle commentedThe attached patch provide the proposed resolution.
Comment #2
xanoThank you for this clean and well-documented patch!
Should we rename this to payment_label() or maybe even Payment::label()? It would be useful outside the entity API scope as well.
I have only worked with entity wrappers once or twice, so I might be wrong here, but do we really need a default if we only use the getter callback for the description property?
Comment #3
pbuyle commentedThe entity callback is invoked from
entity_label()with$info['label callback']($entity, $entity_type)so it cannot be a static method of the Payment class.payment_label()sounds like a valid function name too, I usedpayment_entity_info()only because it's an entity related function.The default case in
payment_entity_property_info()<code> is there as fallback to ensure the function will always return a proper value if used as <code>'getter callback'without proper handling code.Comment #4
xanoWhen doing
$callback(),$callbackcan be any callable. This works in PHP 5.4, but are you saying this does not always work?Comment #5
pbuyle commentedIt does not work in PHP 5.3.15:
and
Comment #6
xanoI installed PHP 5.3 locally and confirmed that this is not possible. If you can make payment_entity_property_get() use payment_label(), then I think it's RTBC.
Comment #7
pbuyle commentedComment #8
xanoComment #9
xanoComment #10
xanoThank you for reporting and fixing this issue!