One thing that bugged me about overriding a view, was that all the fields in the overridden view would be added at the end (and filters, and sorts etc...)

The patch in the next post allows order to be maintained. I don't really like the use of create_function() here, but couldn't see how else to do it unless php 5.3 support is mandated for this module. I think anonymous functions would work better in that case.

I've only tested this for views components, but it works very well.

CommentFileSizeAuthor
#1 features-override-1309312-1.patch3.51 KBcdale

Comments

cdale’s picture

StatusFileSize
new3.51 KB

The patch.

nedjo’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Thanks!

All changes need to be made first to the D7 branch. Could you please adapt for that version (should be only minor difference).

I've assigned you as a maintainer, so once this is ready you can commit to D7 and then D6.

nedjo’s picture

Status: Needs review » Fixed

Thanks, applied.

mh86’s picture

Status: Fixed » Needs work
+++ features_override.alter.inc	2011-10-14 02:42:27 +0000
@@ -9,7 +9,7 @@
+          _features_override_set_item($items[$override->component_id], 'add', $addition['keys'], $addition['value'], $addition['order']);

This code throws warnings with existing feature overrides:

Notice: Undefined index: order in features_override_features_default_alter() (line 12 of modules/features_override/features_override.alter.inc).

I know updating the components will help, but following code would prevent the warnings:

_features_override_set_item($items[$override->component_id], 'add', $addition['keys'], $addition['value'], isset($addition['order']) ? $addition['order'] : NULL);