Here is the start of the feature described in the title.
ToDo: We need to create the second relationship with code instead of the one created with the views interface like in the default view. Cause it creates confusion.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | payment_1533068_03.patch | 27.9 KB | xano |
| #10 | payment_1533068_02.patch | 6.68 KB | xano |
| #8 | payment_1533068_01.patch | 2.85 KB | xano |
| most-recent-status-inside-views.patch | 77.55 KB | open social |
Comments
Comment #1
open social commentedAlso,
I got strange errors in the payment.module, which you can see in the patch. Can you check what is going on there?
That array is empty in my case.
Comment #2
xanoThanks a lot for the patch! Can you share the error messages with us, so we can verify them when testing the patch locally?
Comment #3
xanoWe should put this code in a new handler. This one is for displaying the human-readable title for a status code .
We should put this code in a new handler. This one is for displaying the human-readable title for a status code .
It looks like you're assuming a "payment_status_item_payment_1" field exists.
Also, could you provide detailed code comments? It's probably clear to you, but for most people this is dark magic.
Thanks again for your efforts!
Comment #4
xanoWe should create a new handler for this, because this one is specific for displaying the human-readable title of an already selected status code.
How does this work? It looks like the code assumes a "payment_status_item_payment_1" field exists.
Also, could you provide some detailed code comments? It's probably all clear to you, but for most people this is dark magic.
Thanks again for your efforts!
Comment #5
open social commentedHey Xano,
How does this work? It looks like the code assumes a "payment_status_item_payment_1" field exists.True, I will write a new patch one of these days where I will try to add the table with code instead in views.
Comment #6
xanoHey @goalgorilla, you managed to come up with a new patch yet?
Comment #7
open social commentedHey Xano,
not yet,
I have no idea how to implement a 'shadow' table.. to be precise, we need to declare 'payment_status_item_payment_1' two times when you use that relation in views.
Do you have any idea?
Greets Daniel, GoalGorilla
Comment #8
xanoThe extra join condition doesn't work yet.
Comment #9
xanoIt turns out to be extermely hard (if not impossible) to join {payment} on {payment_status_item} in a way that only results in one row per payment and that is has the last available status. It's probably better to change {payment}.updated to {payment}.psiid and join both tables on {payment}.psiid = {payment_status_item].psiid.
Comment #10
xanoThis patch implements the approach outlined in #9. Before it can be committed, the payment overview view needs to be updated so it no longer uses Payment::updated, but the relationship added by this patch.
Comment #11
xanoNow with updated views.
Comment #12
xano