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.

Comments

moshe weitzman’s picture

Nice ... We really need a generic version of this for CCK Content Copy and others ...

marcp’s picture

Version: 5.x-1.x-dev » 5.x-1.6

Just ran across this today.

Looks like this is fixed in D6.

Patch still applies on 5.x-1.6 Views.

sun’s picture

Status: Needs review » Fixed

Thanks, committed.

dww’s picture

Status: Fixed » Needs review
StatusFileSize
new7.18 KB

Yes, I'd love this, too. I re-rolled to also avoid doing weird stuff like this:

$view->sort = array (
  );

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...

dww’s picture

StatusFileSize
new6.82 KB

whoops, 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.

merlinofchaos’s picture

If 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.

esmerel’s picture

Status: Needs review » Closed (won't fix)

At this time, only security fixes will be made to the 5.x version of Views.