The views_megarow_command_refresh_parent did not work for our custom module, because of the way the function used the entity ID passed into it as an argument for a view down the line. It really doesn't make any sense to use the entity ID this way.
We have a megarow view of commerce line items. The argument is the order ID, so it displays all the line items of that order.
The refresh parent requires we pass in the line_item_id so it knows what to refresh. But then when trying to get the new content for that row, it uses line_item_id for the argument of the view. Very confusing, and it makes the function useless for some common applications of this module.
The views_megarow_get_row function should be able to be passed arbitrary arguments that can then be passed to the view.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | views_megarow-args-2131933-2.patch | 3.36 KB | anybody |
| #1 | views_megarow-args-2131933.patch | 3.36 KB | jazzdrive3 |
Comments
Comment #1
jazzdrive3 commentedPatch is attached. When calling the views_megarow_command_refresh_parent() function, you can pass an optional array of arguments, that will eventually get passed to the view that is used to retrieve the changed content. In our case, we pass in the order id.
This also includes the left out line from the commit on #2028521: Make views_megarow_command_refresh_parent() work with other displays, since this is against dev.
Comment #2
anybodyThanks a lot, your patch works great! I've applied it manually against the latest stable version, because the latest .dev seems older(??).
Everything works fine and the patch is good, but there is a little typo that stops the patch from working:
In the .js part a "=" is missing behind the +:
Should be:
Else the arguments are never being added to the url!
I've attached a corrected patch against .dev!
Please test it and bring it into the next stable release, otherwise other dependent modules (like commerce_recipients) which require views arguments won't work!
Comment #3
mark@redhorseinteractive.com commentedDid you say this patch has already been applied to latest "dev" version?
Thanks in advance.
Comment #5
artusamakOK guys, this is commited, i'm having trouble to test it so i trust you for this use case. ;) Thanks for the patch.