The exported views output has an extra space when creating arrays. I sometimes take the output of the exported view and put it in hook_views_default_views. So, I noticed this coding standards issue when checking my modules with coder's style review.
I'm sure your aware of the coding standards, and I'm not sure why you would intentionally do this, so I'm hoping that it was just oversite. The attached patch removes the extra spaces.
I see that you're getting ready for 6.x, and that some things have moved. I wasn't sure which version to submit the patch for, so if you'd prefer I cut this against another version, feel free to ask. However, it's a pretty simply change, that's easy to figure out.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 174044_views_export_code_style.5.patch | 6.82 KB | dww |
| #4 | 174044_views_export_code_style.3.patch | 7.18 KB | dww |
| views_ui_array.patch | 2.96 KB | douggreen |
Comments
Comment #1
moshe weitzman commentedNice ... We really need a generic version of this for CCK Content Copy and others ...
Comment #2
marcp commentedJust ran across this today.
Looks like this is fixed in D6.
Patch still applies on 5.x-1.6 Views.
Comment #3
sunThanks, committed.
Comment #4
dwwYes, I'd love this, too. I re-rolled to also avoid doing weird stuff like this:
when there's no sorts for the view. Makes the patch larger, but I think it's worth it. Tested and working fine on my views.
Note, neither patch handles
$view->access"correctly" since it's using var_export() which generates the thing you see with sort above...Comment #5
dwwwhoops, didn't see sun had already committed and we cross posted...
here's an updated version that applies to the end of DRUPAL-5 branch.
Comment #6
merlinofchaos commentedIf we're going to fiddle with this code, I'd recommend grabbing views_var_export from the D6 version and using that. It provides generally cleaner exports.
Comment #7
esmerel commentedAt this time, only security fixes will be made to the 5.x version of Views.