Hi there,
I’ve successfully migrated from Commerce Kickstart 7.x-2.23 to 7.x-2.26. During the Feature upgrade from 1.x to 2.x all my field settings are moved to „hidden“, the field label description, Help text and Wrapper markup is set to the default settings! I’ve made a couple of changes on the Display tab e.g. Full content, teaser… It seems like that I have to go through all my Content Types and reapply my changes.
Thanks to mglaman for pointing me in the right direction!
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | commerce_kickstart-2532292-30.patch | 2.65 KB | mglaman |
| #23 | commerce_kickstart-2532292-23.patch | 2.11 MB | mglaman |
| #19 | commerce_kickstart-2532292-19.patch | 2.77 MB | mglaman |
| #16 | commerce_kickstart-2532292-16.patch | 2.94 KB | mglaman |
| #14 | commerce_kickstart-2532292-14.patch | 2 KB | mglaman |
Comments
Comment #1
howdytom commentedComment #2
howdytom commentedComment #3
howdytom commentedComment #4
mglamanTagging for kanban board: http://contribkanban.com/#/board/commerce_kickstart
Comment #5
mglamanAble to reproduce. Adjusted field instance display settings on Teaser to move from "hidden" to "visible". On upgrade to HEAD the field display settings reverted.
Comment #6
mglamanThis might also be changing field base configurations.
Comment #7
mglamanComment #8
mglamanIn testing I have tried
Non-Demo, Interactive update
Results: not reproducing. Feature shows up as overridden as expected. Strongarm for attached extras [from product entity] and Instance [from displaying product catalog].
However, if I repeat the same steps but use "drush updb" instead of visiting update.php it is reproduced.
Comment #9
howdytom commentedI can’t agree on this.
Updating the site via update.php and "drush updb" reverts all field display settings. I am able to reproduce it with both workflows.
Comment #10
mglamanYou're right. It is either way. I reviewed the rebuild code for field_base and field_instance. I think the only way to fix this is to implement the "locking" feature provided by Features to prevent rebuild from happening in lite_product and product field_base and field_instance. Testing this now.
Comment #11
mglamanPATCH! Lockin' those fields DOWN.
Tests: https://travis-ci.org/commerceguys/commerce_kickstart/builds/71491448
Comment #12
howdytom commentedFirst off, thanks for your great work. I’ve successfully applied the patch.
I’ve updated via „drush updb“. So far Field Display settings are preserved. Awesome!
However all changes to the field setting e.g. labels, description, field order... are still reverted. I hope this helps.
Comment #13
mglamanArgh. Features is sure doing what it's meant to do ;) preserve configuration. I think locks need to be put on all components of the Feature's we're expecting people to customize, then. I'll update the patch.
Comment #14
mglamanUpdated patch to lock variables. I think this should be fine - field base, field instance, variable.
Comment #15
mglamanJust realized this won't work. We need to also set this on hook_install() to lock those components.
Comment #16
mglamanHere we go! This sets it on install, too. If tests pass, going to commit.
https://travis-ci.org/commerceguys/commerce_kickstart/builds/71515592
Comment #17
howdytom commentedHello Matt,
unfortunately commerce_kickstart-2532292-16.patch reverts the Field Display settings again. Also, field settings are still reverted e.g. labels, description, field order, image style… ;-) Tested with a Commerce Kickstart installation CK 7.x-2.19 -> CK 7.x-2.26 using update.php and drush updb
Another Test using a fresh CK installation 7.x-2.23 with non-demo store. I’ve made a couple changes to the display and field settings.
Than I applied the patch and upgraded to CK 7.x-2.26 using drush updb. Same result as above.
Anyway, I hope this helps.
Comment #18
mglaman:/ I'm not sure how #16 could break, when the difference from #11 is setting the lock after rebuild.
I'm updating the tests to import a customized site DB and ensure customizations stick, so we have less manual testing to do.
Comment #19
mglamanOK! Here is a patch which includes a modified 7.x-2.22 install with Behat tests to verify the changes. It also adds a Travis CI environment to test by importing the database.
It's passing locally for me.
Comment #20
howdytom commentedThanks again for providing us with such a quick patch!
I’ve tested the patch on a fresh install
CK 7.x-2.22 -> CK 7.x-2.26
and on a existing CK site.
CK 7.x-2.19 -> CK 7.x-2.26
The field display settings are preserved. GREAT!
The bad news: The field settings are still reverted e.g. labels, description, field order, image style…
Comment #21
mglamanOk.. so Field Base is screwing up. Once I get the regression environment to run properly on TravisCI I'll extend the tests for all of these cases.
It's the last one in the matrix, but it should run properly this time: https://travis-ci.org/mglaman/commerce_kickstart/jobs/71603162
Comment #22
mglamanTests passed! https://travis-ci.org/commerceguys/commerce_kickstart/jobs/71603190
The following was checked
Need to update the SQL dump for some field_base stuff, and ensure field display weight.
Comment #23
mglamanHere is the latest patch, and here is a snippet of the Behat test which checks field base changes and field instance changes, along with strongarm (variable.)
Link: https://github.com/mglaman/commerce_kickstart/blob/features-rebuild-madn...
Comment #24
howdytom commentedThanks for your enduring support. I think we are almost done.
Your patch is working for Product Field Settings as well as for Product Field Display Settings!
It's not working for the Content Types (admin/structure/types) Field Settings and Field Display Settings.
Here, all field settings are reverted e.g. labels, description, field order, image style…
Comment #25
mglaman@howdytom can you specify what types in particular? This patch is covering field and variable information for commerce_kickstart_product and lite_product, so the Product Display type and demo node types, along with matching product types.
Comment #26
howdytom commented@mglaman: Sure, Content Type Ad Push
I've customized various field settings e.g. title_field and field_image
All settings are reverted. I hope this helps
Comment #27
mglaman:) That explains it, then. This is only targeting product display node types, when it should be any Feature which provides node types, field instances, etc.
I'll have a new patch incoming
Comment #28
mglamanTrying something new.
Added a function to mark the entire Feature as locked. It runs on install, after rebuild, now. And there's an update hook to set it. This should preserve customization across the board, but need to make sure upgrades/install runs right.
Test run: https://travis-ci.org/mglaman/commerce_kickstart/builds/71672401
Comment #29
mglamanSo I think this issue has been tackled the incorrect way. I think the proper solution will be to explore Features Override. Features is technically just doing it's job, but we need to allow customization on top of it, which is the purpose of the Features Override module.
Comment #30
mglamanI think the Features Override route is best path. However I discovered Features doesn't really pick up alters for the previous API, where fields were in a single config. Here is a patch which adds support for Features Overrides created on Features API 1 for field exports (pre 7.x-2.24 CK2.)
This way users can export their overrides and upgrade while keep their changes, and able to re-export into Features API 2.
This is cleaner than toying with component locks and pushing for better practices when customizing a distribution.
Before committing I want to create a sample Feature which implements some overrides, and during tests it becomes enabled and changes verified.
Comment #31
mglamanTest verifying usage of Features Override for keeping customizations: https://travis-ci.org/mglaman/commerce_kickstart/builds/71716533
Comment #32
howdytom commentedUnfortunately this patched didn’t work for me either. I’ve also tried to use the Features 2 component lock. All field and field display that are created during the initial Commerce Kickstart installation (non-demo store) are reverted.
Due to lack of time I’ve moved forward and migrated another CK site. Than I’ve re-applied all field settings manually.
Comment #34
mglamanTests pass! Features Overrides is being tested on a 7.x-2.23 upgrade to HEAD.