Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Checkout
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2011 at 19:59 UTC
Updated:
4 May 2011 at 20:51 UTC
Maybe I'm wrong but it looks like after a save it's impossible to alter the values of $checkout_panes by using commerce_checkout_pane_info_alter().
Attached patch should fix that.
Btw. is array_merge really necessary here?
| Comment | File | Size | Author |
|---|---|---|---|
| commerce-hook_commerce_checkout_panes_info_alter-unable-to-alter.patch | 706 bytes | das-peter |
Comments
Comment #1
rszrama commentedHaven't had a chance to test the patch yet, but yes, the merge is a necessary evil until #875034: Convert hook_*_info() hooks to return arrays instead of objects is implemented.
Comment #2
rszrama commentedAhh, I see what you mean... yeah, it's redundant to use an array_merge() when the first argument is an array merged via the + operator. : P
In any event, it does seem like a weird place to allow alteration... it should at least be after default values have been set. That said, I'm a little leery of allowing alteration after values have been loaded from the database, since the loading of values from the database is effectively an alter administered through the UI. However, it still might be the right thing to do... I'll think on it. In the meantime, we have removed that +.
Comment #3
rszrama commentedOk, what I ended up doing with this (finally) is moving the code that merges in data from the settings form into the previous foreach loop. So the chain of data inclusion goes like this:
Commit: http://drupalcode.org/project/commerce.git/commitdiff/a0566a7