Closed (fixed)
Project:
Features
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2011 at 21:31 UTC
Updated:
30 Mar 2012 at 15:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
mortendk commentedactually this happens if i wanna update an existing view - am i the only one that gets this error
Comment #2
merilainen commentedNope, I have the same problem. I'm using dev-version of Views at the moment. Which is why the call happens on a different line, 1550.
Comment #3
tbenice commentedI had the same exact problem and clear-cache all allowed the feature to revert. Try that.
Comment #4
febbraro commentedIs this still a problem? I can't reproduce.
Comment #5
diricia commentedI have this problem.
My views are in my feature. However when I revert, I get the fatal error. When I do a drush cc all - the error disappears and the view is in list of views. If I do another drush cc all (nothing else) the views disappear from the list (database)
Attached sequence, screen shots and feature.
Screen shot 1 shows the views are not in the list
$ drush fr simplybiz_job_spheres
Do you really want to revert views_view? (y/n): y
Fatal error: Call to a member function delete() on a non-object in /var/aegir/platforms/bc77_stage_20110901/sites/all/modules/contrib/views/views.module on line 1463
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to a member function delete() on a non-object in /var/aegir/platforms/bc77_stage_20110901/sites/all/modules/contrib/views/views.module, line 1463
$ drush cc all
'all' cache was cleared [success]
$ drush fr simplybiz_job_spheres
Do you really want to revert context? (y/n): y
Reverted context. [ok]
Notice above that I'm not asked if I want to revert the views. Screen shot 2 shows the views are now in the list
$ drush cc all
'all' cache was cleared
Screen shot 3 shows the views have disappeared again
I would suggest removing the menu, context, strong arm and user permissions files from the feature. I've left them in for completeness
Comment #6
diricia commentedMy problem was solved by using the development version of views.
Comment #7
febbraro commentedOk sounds good, it this is still a problem reopen.
Comment #8
mrfelton commentedNothing to add - Just confirmation that I had the same problem, and upgrading Views to latest dev code resolved the problem.
Comment #9
mrfelton commentedNah, sorry. I still get this a lot. It seems to happen when I add a new to an existing feature, and then try and revert the review on another copy of the site to pull in the new view. I can't work out the exact steps to revolve, but it involved clearing the registry and the cache a number of times
Comment #10
mrfelton commentedSee #1331656: Components from Features that contain field_collection views go missing for another description of the problem, and the steps to resolve (run
drush fl, clear cache and then rundrush flagain). This only seems to affect field_collection views, which is why I posted the issue over there. But I suspect the problem is with Views.Comment #11
mrfelton commentedAttached is the feature that is giving me the problem.
Views 7.x-3.x-dev with #1032836: Call to a member function unpack_translatables() on a non-object applied
Features 1.0-beta4 with #813760: CTools Page manager pages do not revert properly applied
CTools 7.x-1.x-dev with #1275886: Error - Notice: Trying to get property of non-object in menu_block_view_alter() applied
Comment #12
tim.plunkettThe circumstances where I can reproduce:
Create a feature with a panel.
Create a view with a content pane, add the content pane to the view, add the view to the feature.
Commit that code, deploy it.
On a site with a clean database that never knew that view existed, get the new code and revert the feature.
ctools_component_features_revert()attempts to load an object withctools_export_crud_load(), and then calls_ctools_features_export_crud_delete()on it without checking to see if it is not an object.In the case of a new view, the object doesn't exist yet, hence the error.
The workaround is to create a dummy view on the clean site, merely to revert it.
Comment #13
eMuse_be commented#3 did the trick: clear cache
Comment #14
drzraf commentedI can reproduce and confirm that the clear-cache workaround works,
but still an issue anyway.
The problems is around ctools_export_crud_load();
I've
CTOOLS_API_VERSION = 2.0.4, so that's what_ctools_features_export_crud_loadcalls.[edit] Further down the road,
ctools_export_load_object(/modules/ctools/includes/export.inc):It is called with correct args: table = views_view, name = vassoc but it returns an empty array();
Maybe ctools people may help here ?
Comment #15
hefox commentedOh, I've seen this error also though I was doing something funny to produce it, if I recall correctly. Some error checking is all that's needed to fix it, if I recall correctly.
Comment #16
bradjones1Given how the symptoms of this problem mimic #1331656: Components from Features that contain field_collection views go missing (linked above in #10), I am wondering if this isn't a byproduct of #994140: Modify .module file when a features.inc is added, which solved that problem and (so far) this one, too.
Can anyone look at the affected .module files and see if they're missing a feature_name.features.inc include? Would be great to mark this as duplicate and chalk this up to a relatively simple problem.
Comment #17
alanmackenzie commentedI can confirm that drush cc all fixed this issue for me.
The feature I was reverting has always had the feature_name.features.inc include statement in the .module file.
Comment #18
imiksudrush cc all helped me too :)
Comment #19
nicholasthompsonA cache clear helped here too...
Comment #20
bradjones1Going to close this as can't reproduce based on the past 4 comments (plus others above)... if someone can post a guide to reproducing this on a clean install, please do and re-open.
Comment #21
Volx commentedI saw the same error while doing pretty much the same as comment #12. It contains a step-by-step guide to reproduce and actually nails down the error in my opinion, that is ctools_component_features_revert trying to delete an object that does not exist. A simple check fixes the error at least for this case. Patch is attached.
And like I already said here http://drupal.org/node/813760#comment-3700694 , I think that the Features integration of ctools components should be handled within the ctools module to avoid problems like this one.
Comment #22
kirie commentedI encountered the same issue, and while the patch in #21 made the error go away - it did not fix the issue. In my setup I also noticed that I would sometimes get the following warning (I'm using Drush):
myfeature.module does not appear to include the myfeature.features.inc file.After a bit of searching found this isuse: #994140: Modify .module file when a features.inc is added
After manually adding
include_once('myfeature.features.inc');to my myfeature.module I have had no issues, and I can now revert my features again.Comment #23
dawehnerUpdate status.
In general this should fix the issue, though it's a question whether this is the actual right place to fix that.
Maybe there is a real bug behind this, when the objects can be loaded, thought this is much harder to find out.
Comment #24
wiifmHad exactly the same issue on #1481150: PHP Fatal error: Call to a member function delete() on a non-object [views.module on line 1566] - and the patch in #21 seems like it is very like mine.
(on a related note, it is nice to see we would solve it the same way)
This is a critical bug for our sites, as aegir will fail to install the site is PHP throws a fatal during the installation.
Comment #25
kirie commentedI encountered the same problem (again) - and applying the patch in #21 fixed the problem. The problem occurred when I tried to revert a feature which added a new view (the first and only view for that feature) - pretty similar to #12, albeit without the panel part.
Comment #26
wiifmCan #21 be committed, it goes a long way to address the immediate concerns of a lot of people. Have tested the patch and can confirm our intall profile does work with it applied (and horribly not on stock beta 6)
Comment #27
hefox commentedThis seems like a correct solution to me, however I'm thinking it should also add a check for $object->export_type & EXPORT_IN_DATABASE so it only runs on overridden objects.
That patch attached.
21 is still rtbc, but this patch may be more useful.
Comment #28
tim.plunkettOh bitwise operators. I think the second half should be wrapped in parentheses for clarity, otherwise this looks fine
Comment #29
mpotter commentedCommitted with additional parens as per tim.plunkett. db61d14