Hi

I'm trying to combine this with Message module, for keep user logs consistently. I'm using "after changing a payment status" (also tried other events too) and I cannot found how to select the payment status (for both, the current and the unchanged version)

Rules data

Comments

xano’s picture

Title: Add payment status to available rules data » Expose payment status items to Entity/Rules
Assigned: Unassigned » xano
Status: Active » Needs review
StatusFileSize
new2.11 KB

This patch partly exposes payment status items. The old payment status for that Rules event is now fully exposed. Payment status items on payments are not fully exposed yet, as I have haven't been able to find out how to do that using hook_entity_property_info() yet, so that part needs some work.

xano’s picture

xano’s picture

StatusFileSize
new3.17 KB

This patch adds Payment::current_status, which contains the PaymentStatusItem that was last set using Payment::setStatus(). It is untested, but I believe this approach should work. However, we'd ideally fake this property for a Rules token, as this patch adds duplicate data that may lose sync if a developer doesn't read the documentation and writes to Payment::current_status directly.

xano’s picture

StatusFileSize
new3.48 KB

Improved code comments.

dariogcode’s picture

Hi Xano, thanks for the support. Where I should apply this patch? in the dev or the stable version? (I think i have a "patched" version of payment and want to move to the latest version if all is in dev)

Thanks!

xano’s picture

Ideally you'll always patch your local Git working copy, because that contains the latest code. Otherwise the dev will work in most cases, but not all.

xano’s picture

If you want this feature to be well (the previous patch is a workaround), please help fix #1946746: Negative deltas for list properties and #1621084: Support list<struct> type tokens.

dariogcode’s picture

This doesn't work for "data selection mode" in rules and fail (And probably fail "direct input mode" in some cases).

xano’s picture

I'm sorry, what exactly doesn't work? What does or doesn't happen?

xano’s picture

Assigned: xano » Unassigned
xano’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

There is no chance that this will ever become possible, since the focus on Rules has shifted to the Drupal 8 port.