I'm consistently seeing this bug when using Features to manage deployment. We have three environments, dev, stage and production. When we code/configure new modules in Features and re-package them, they are fine on the dev environment, but when moved to stage the page manager pages *refuse* to revert, even after all the cache clearing and drush features-reverting in the world!
The only way to fix this is to go in to your CTools pages via the Page manager UI, edit your pages that are not reverting in turn (you'll notice when this happens at least one variant will still be Overridden, which is the problem), revert a variant, save, revert the entire page in page manager, then everything is ok again.
Quite a PITA, but at least I can get around it. At first I thought it was totally broken!
This only happens when you are *replacing* an existing page manager page with Features. Features revert does not revert it.
| Comment | File | Size | Author |
|---|---|---|---|
| #55 | features-813760-55.patch | 763 bytes | tim.plunkett |
| #44 | features-page_manager_revert-813760-44.patch | 767 bytes | galooph |
| #39 | features-page_manager_revert-813760-39.patch | 839 bytes | galooph |
| #38 | features-page_manager_revert-813760-38.patch | 911 bytes | galooph |
| #32 | features-813760-32.patch | 674 bytes | tim.plunkett |
Comments
Comment #1
seanrStill happening in Beta8. If I go to admin/build/pages, it shows the page is "Normal" rather than overridden or default as it should.
Comment #2
dawehnerI found a workaround which might be has to be reflected in code.
Revert your variant, save the page, revert the panel itself.
Comment #3
tim.plunkettsubscribe.
Comment #4
damienmckennaThis is quite possibly related to another issue, #853120: Use ctools functions instead of querys for revert features, so hopefully once that is resolved this issue will also disappear.
Comment #5
tayzlor commentedsubscribing, seeing this problem when reverting a feature as well.
Comment #6
wizonesolutionsSubscribing, this one is driving me mad. Digging into the code, all I see it doing is deleting the page from page_manager_pages, but it doesn't seem to do anything else? Not sure if I'm missing it. Where is it supposed to actually restore the page saved in modulename.page_defaults.inc?
Comment #7
wizonesolutionsUpdating version, seeing this in rc3.
Comment #8
wizonesolutions@ #2 - your workaround worked for me. Thanks a lot! I wrestled with this for hours.
Comment #9
dalin#2 workaround works for me too.
Comment #10
mikebell_ commentedThis still occurs. greg.harveys fix works.
Comment #11
randallknutson commentedSubscribing...
I am seeing this as well and it is very annoying. The workaround does work but when you've got lots of panel pages, it takes a lot of work to get things reverted.
Comment #12
dafederThis is a duplicate of #744450: Why would a feature not revert?
Comment #13
greg.harveyAppreciate you trying to tidy the queue, but not really. 'Why would a feature not revert?' is:
a) WAY to generic to be a useful issue title for maintainers
and
b) not at all targeted towards a specific issue.
More useful would be to politely close #744450: Why would a feature not revert? and ask the contributors there to raise individual issues for specific solvable problems (like this one). It is far more sensible to break this issue in to smaller ones - I bring your attention to #22:
http://drupal.org/node/744450#comment-3489728
That's not a dupe - it's bringing in to focus a specific issue.
It's a shame d.o does not support meta-issues yet, but there is talk about that. Until then, closing issues like this is NOT the answer, IMHO. This issue is very much active and is far more likely to get a meaningful patch than #744450: Why would a feature not revert?, which has a snowball in hell's chance, frankly. ;-)
Comment #14
dafederGreg, that makes perfect sense - I will try to drive the redundant traffic back this way then. Appologies for jumping the gun.
Comment #15
karschsp commentedsubscribe
Comment #16
Volx commentedI think I figured out what the problem is.
A page manager page contains 0 to n handlers (as far as I can see, these are the variants in the UI). The panels module has the panels_context handler which contains a display, which in turn contains panes. Now when you export the page with the features module, all of that gets exported into hook_default_page_manager_pages(). For ctools the elements are all separate objects (page, handler, display, pane). When building the page from code the hook is being called, which in turn builds all required objects and all is fine.
Now whenever you change anything in the page with the UI, all settings are written into the database, each object into its own table. If that is the case, the hook is not being called, everything is build from the database and again everything is fine.
Now when you try to revert the feature all that is required is that the database entries are deleted. But this only happens for the page. The other objects (handler, display, pane) remain in the database and are thus still considered overridden.
So what needs to be done is to delete the handlers, displays and panes that belong to a page. Seeing that features.ctools.inc already contains a special function for page_manager_pages I guess it's the easiest to simply add a another one that implements hook_features_revert for page_manager_pages. This fixes the issue on my side, but adds to the "wild hack" that all of features.ctools.inc is. In my point of view, the whole file should be moved to the ctools project, since it is ctools job to implement the features API and I think the ctools maintainers can do a better job of it, because they know the inner workings of their tools. Maybe thats something for the 7.x releases.
Comment #17
greg.harveyYay! Thanks for the patch. Setting to 'needs review'.
Comment #18
Alexander N commented+1
Working fine on my machine!.
Comment #19
m_z commented+1 for delegating responsability to the cTools / Panels maintainers (to be save in case of API changes in the future) - is there already an issue?
#16 works fine (thanks @Volx) and saves much time compared with #2 (which was my solution up to now)
If anybody recognizes any bad side-effects of #16 patch, please post it here. Since page_manager_page_form_delete_submit() does the same thing, it should be a safe solution.
Comment #20
greg.harveyActually, this patch is for ctools, it has no business in the Features issue queue. Moving.
Comment #21
greg.harvey*sigh*
I'm an idiot. Sorry. Putting it back - I don't know why I read that wrong. This is a Features patch.
Comment #22
greg.harveyOk, tested, seems to work fine. That's three reports. Will make R&TBC.
Comment #23
raphaelhuefner commentedOnly re-formatted the #16 patch so that it hopefully works with drush make. Now it is relative to the "features" project directory instead of being relative to sites/all/modules[...]
Comment #24
nicolash commentedsubscribe
Comment #25
nicholasthompsonJust wrote a blog post on this... THEN I find this issue :-)
http://www.thingy-ma-jig.co.uk/blog/16-02-2011/batch-revert-views
That post has two snippets you can run from devel/php to forcefully revert/delete your views and panels.
Comment #26
nicholasthompsonOh yeah, one thing I did differently was to use
array_walkrather than a foreach. Practically no different. Not sure if there is an relevant performance difference...Comment #27
grendzy commented#23 worked for me. Thanks!
Comment #28
mstef commentedSubscribing
Comment #29
ericbroder commentedI tried the patch in #23. I have a panels page with 3 rows and each row has div classes such as:
After reverting, the row div classes change to:
...which breaks my panels page theming, and is not a proper revert, right?
Version:
Pressflow 6.20
Chaos tool suite 6.x-1.8
Features 6.x-1.0
Panels 6.x-3.9
Comment #30
mcpuddin commentedHey Eric,
Are you sure this is related to the patch? All the patch does is delete all the pages from the database on revert. Could you add an attachment of that exact panel/page manager configuration as an attachment to this queue as well so I can take a look?
James
Comment #31
mcpuddin commentedAlso Eric, in general do you know what causes that "new" to replace the numbers? Is that something auto-generated by the flexible layout or is that something you manually configured in you reverted feature?
Comment #32
tim.plunkettWhatever the cause of the issue in #29, it wasn't introduced by the patch in #23.
This is a reroll with git prefixes.
Comment #33
logickal commentedPatch on #32 worked great for me.
Comment #34
ericbroder commentedThanks for the feedback. I think my comments in #29 describe an issue that is separate from this one here and unrelated to patch #23.
The issue in comment #29 actually starts when I first create/export the feature, and the myfeature.pages_default.inc file has code like:
Then if I revert to code later I notice that the div classes changed to say "new" in them.
Comment #35
eugenmayer commentedpatch in #32 misses:
but all in one, it works out pretty good for me. Adding a revert hook is only the first side of the medal though, what about the rebuild hook?
Comment #36
m_z commentedAs far as I understand there is no need for a rebuild hook since Panels stuff works from database OR code - in contrast to CCK fields, permissions etc. that ONLY live in database.
So by deleting the (overridden) database entries for Panels pages, the (default) code definitions for your Panels pages will be used.
Am I wrong with that?
Comment #37
hongpong commentedsubscribe - this is a major problem!
Comment #38
galooph commentedHere's the patch from #23 re-rolled with the extra line from #35.
Comment #39
galooph commentedForgot to make the previous patch relative to the features module directory - fixed.
Comment #40
ericbroder commentedHi galooph, I think you got the patch backwards by accident, the pluses and minuses should probably be reversed.
Comment #41
lpalgarvio commented:( +1
Comment #42
hefox commentedThis should likely have been set back to needs review; it looks like none of the patches are ready unless go through and change the minuses to plus on last.
I don't use page manager, so leaving this for tim.plunkett, just wanted to fix the status.
Comment #43
hefox commentedComment #44
galooph commentedDoh! No idea how I managed to get the previous patch back to front!
Here's the patch from #39 the right way round.
Comment #45
elliotttf commentedApplying this patch definitely allowed some of my features to revert correctly. Marking as RTBC...
Comment #46
eugenmayer commentedalso votinv RTBC, using this patch over a long time now ( more then 6 months or so )
Comment #47
rory_o commentedSub
#44 works fine; Features beta3, ctools RC1
Comment #48
Dean Reilly commentedBeen using it for a couple of months now without any issues.
Comment #49
e2thex commentedTagging
Comment #50
ju.ri commented#44 worked for me, thanks!
Comment #51
kndr#44 works for me. Thank you! There is one side effect: reverting takes much more time.
Comment #52
neilnz commentedJust subscribing. The patch worked for me too.
Comment #53
hefox commentedTaking all the reviews to mean it's a-okay. Commited to 6.x; hopefully I got everyone's names in the commit message >.O
http://drupalcode.org/project/features.git/commit/31cbcf0
Patch applies cleaning for 7.x, but no idea if it works.
Comment #54
seanrCan confirm this applied cleanly in D7, haven't yet had a good opportunity to test an actual revert.
Comment #55
tim.plunkettRerolled for D7 style.
Comment #56
tim.plunkettThis is ready.
Comment #57
pcambraI've just tried it and it works for my case. Confirming the RTBC.
Comment #58
febbraro commentedCommitted to 7.x. Thanks everyone.
http://drupalcode.org/project/features.git/commit/0d9d2aa
Comment #59
eugenmayer commentedWhat about d6?
Comment #60
tim.plunkettEugenmayer, this was committed to D6 in #53.
Comment #61
eugenmayer commentedTank you!
Comment #63
rickmanelius commentedI hate to reopen this ticket, but I've recreated and reverted over and over again and simply cannot get this feature to see it's still default!
I just updated to the latest ctools (7.x-1.x-dev) and I'm running the latest stable versions of panels and features (7.x-3.0 and 7.x-1.0-beta6). Like the previous authors, these panels existed before and I'm trying to use features to now track them in code. But even when I get successful messages:
Reverted all page_manager_pages components for custom_features_content.
Reverted all panels_mini components for custom_features_content.
They refuse to revert without manually going into the panels.
Am I doing something wrong? Do I need to move to the dev versions of panels/features?
Comment #64
jenlamptonCtools 7.x-1.0
Features 7.x-1.0-rc1+7-dev
Panels 7.x-3.2
Same thing here, when I ask a feature to revert a page manager component of the feature, it gives the message "Reverted all page_manager_pages components" but when viewing the feature, the Page manager section still shows the feature as overridden.
Comment #65
zhangtaihao commentedThis new phenomenon is now related to #1369246: Features incorrectly reporting panels as overridden. Pid counting changed..
If that issue is in fact what you observe, please close this issue as "closed (fixed)".
Comment #66
ianthomas_ukMarking as needs more info until we can show that this is a recurrence of the reported issue and not a duplicate of #1369246
Comment #67
srjoshIt's been well over a year and no one has come forth with more information. Closing this. Feel free to reopen if you can provide more information.