I experienced an issue where default View components appear to be overridden at admin/structure/features, but experienced a PHP timeout when trying to view the specific diff of the component.

After looking into the issue, I saw that features_get_signature() was returning an empty signature for the default state of the component.

This happens because Features isn't actually including module.views_default.inc files.

The attached patch restores the default hash and makes the View show up as being default. This may be a separate issue from #1408338: View export showing as "FALSE" in diff, makes feature wrongly show as overridden, where the default state of the view is visible but the override shows the default Views export as FALSE.

Comments

pol’s picture

I'm not able to test this patch but I think that's the way it should be.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Looks right to me as well.

mpotter’s picture

Committed b4c34d1

mpotter’s picture

Hmm, actually this isn't the correct way to handle this after all, and actually breaks with the latest version of Views. The specific check for 'views' was left over from D6. In D7 the "views_view" is provided via CTools. The problem was actually related to past problems with ctools_component_features_api that was returning the incorrect api version. Removing this for now and closing issue as "cannot reproduce". If you feel this is still a problem in the latest 7.x-1.x-dev version you can re-open it with more info on reproducing it.

mpotter’s picture

Status: Reviewed & tested by the community » Closed (cannot reproduce)
geek-merlin’s picture

Title: Default View component shows as overridden (module.views_default.inc not included) » Defaults only show "false" for views and others (foofeature.views_default.inc not included)
Priority: Normal » Major
Status: Closed (cannot reproduce) » Needs review
StatusFileSize
new1.9 KB

I can reproduce this with today's dev of features, views and ctools:
* created and deployed feature with a view
* feature says "overidden"
* "defaults" in diff view only show "false"
(btw, the same problem is with entity_path exports)

hunted this down and noticed:
* views defaults are saved into foofeature.views_default.inc
* the include code in features_include_defaults() delegates inclusion to ctools_plugin_api_include() and does NOT include said file (for ctools-api-enabled mocules)

one solution would be to use the ctools api file schema for ctools-api-enabled modules BUT that would break existing features.
so for now we need inclusion of "features style" inclusion files too.

hacked that together in attached patch. tested and worksforme.
(i really wonder why this is unfixed for so long or if i am missing something relevant. =:-)

----------------------------------------------------------------------------------
additional info:

print_r(features_get_components('views_view'));

Array
(
    [name] => Views
    [default_hook] => views_default_views
    [default_file] => 2
    [module] => views
    [feature_source] => 1
    [api] => views_default
    [default_filename] => views_default
    [current_version] => 3.0
)
geek-merlin’s picture

Status: Needs review » Fixed

forget the patch, i'm just lacking sleep:

a simple

"include('myfeature.features.inc');"

in myfeatures.module fixes the issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.