I have run into this issue quite a few times and its somewhat infuriating. The title doesn't explain it well but let me attempt to try and make it more clear.
As an example, configuration.inc currently stores both the default image styles and the node type information (so it implements hook_configuration_node_info and hook_configuration_image_default_styles). Let's say I have added in all my sets to configuration and to the datastore. Its all splendid.
Down the line, I need to change just an image style config (or could be mutiple image style configs). But only in that side of the configuration. The activestore shows there are changes and I decide to write from the activestore to the datastore.
When I now do a diff of my configuration.inc file, it'll show that the image style config has come through cleanly; however, it will also show that implementation of hook_configuration_node_info is now missing (so none of my content types are now tracked). This problem is particularly rampant with display suite since it stores multiple configurations in the same file so I have to manually add my diffs to the file (making what would take at most a couple minutes into something that is 30+ minutes if I have a lot of changes).
I'll try and figure out where the issue is but one possible way to solve it is for any / all hooks to get their own config file or to rebuild the entirely of whatever hooks are stored in a particular config file.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | 1538502.ctools_fix_and_test.28.patch | 23.45 KB | GDrupal |
| #26 | 1538502.ctools_fix_and_test.26.patch | 23.54 KB | GDrupal |
| #22 | configuration-tests-1538502-22.patch | 769 bytes | lucascaro |
| #17 | 1538502.diferent_files.17.patch | 4.45 KB | GDrupal |
| #6 | 1538502.diferent_files.6.patch | 5.12 KB | dagmar |
Comments
Comment #1
dagmarNow I have better understanding about how this module works I will try to fix this important issue.
Comment #2
dagmarI tried to figure out what was happening here. But I couldn't find an easy way to fix this.
However, in my opinion, is a lot easier to have different files for different configurations. In fact, this makes a lot of sense, it's more visible to track using VCS, and users can see really quickly what configurations are being exported just taking a look to the files saved in /config.
This patch makes the content types and images use they own files to storage they configurations. Also includes tests for overridden node types.
I made some tests and the configuration for each component is complete rewritten into the file, so, if you change only one content type, all the exported content type will be saved again.
Comment #3
dagmar#2: 1538502.diferent_files.2.patch queued for re-testing.
Comment #4
dagmar#2: 1538502.diferent_files.2.patch queued for re-testing.
Comment #6
dagmarRe-rolled
Comment #7
GDrupal commentedRTBC Thanks @dagmar!
Comment #8
btmash commentedLooks like this works well between the node/image changes for configuration inc. I'm going to test this out for display suite as well where I encountered this issue the most (it uses ctools so I should be able to answer shortly).
Comment #9
btmash commentedHmm...there seems to be some other strange behavior now (this likely makes sense as another issue) - the image preset goes to a different file correctly; however, if there are changes to the file configuration, they do not get 'sensed' correctly and will create a new image effect (so you have to into your config and change it back as needed). Its a small issue, however and not exactly related. Back to more testing.
Comment #10
btmash commentedUnfortunately, the issue still comes up for ctools exportable plugins. It seems to be that the 'default file' is what the exportable goes by. But if a module exports all of the hooks to the same file, then that would bring up the same wipe issue. Looking at my set of modules that have ctools exportables, display suite puts its exportables into a file named ds.inc. And panels would put its page_manager exportables into a file called pages_default.inc. I'm wondering if we could change line 372 of configuration.ctools.inc from
to
It would guarantee each component/function is then its own file.
Comment #11
lucascaro commentedThanks @BTMash I think that's what we need to move this issue forward. I wonder how all these changes would work with the rest of the api like configuration_download_diff() and configuration_write_exports(), etc. In theory it should be ok, right?
Comment #12
dagmarCould we split this into two issues? To properly test CTools integration we should write a custom test module.
Comment #13
lucascaro commentedI think that, since configuration.ctools.inc is part of the configuration module (that is, we provide integration with ctools in configuration) the integration tests for ctools belong in the configuration module (it's just like the support for image styles).
Comment #14
dagmarYes, but I mean, CTools will not be tested by the bot unless you add Ctools as a dependency of configuration management module.
Comment #15
GDrupal commented@dagmar you can add it as a dependency for a configuration test module... take a look how features implements that.
Comment #16
GDrupal commentedComment #17
GDrupal commentedOriginal patch re-rolled and tested... @btsmash issue still pending... i'm on it that will take a while.
Comment #18
GDrupal commentedComment #19
GDrupal commentedComment #20
GDrupal commentedComment #21
lucascaro commentedCommitted the partial patch from #17.
We still need to deal with #10 so setting to needs work.
Comment #22
lucascaro commentedThanks to this patch we don't need this exception anymore for the tests:
In ConfigurationTrackingTest::testTracking
changed to:
Comment #23
lucascaro commentedComment #25
lucascaro commentedit failed because I had already committed the patch so it's not applicable....
(here's the test result for the commit: http://qa.drupal.org/pifr/test/219688).
Leaving as needs work so we add support for ctools for this issue.
Comment #26
GDrupal commentedThis patch provides support for ctools to avoid the issue on http://drupal.org/node/1538502#comment-6270296
It includes a test for views for checking the correct behavior. From this issue i'm noticed that a bigger re-factory is needed so this patch only fix the issue and I'm creating another post for tracking the re-factory.
Comment #27
dagmarWhy?
The original line is the correct one.
The rest looks good.
Comment #28
GDrupal commentedIt was added it in the debugging process, I was getting strange values for $status... and since $config[$component][$identifier]['status'] comes as string and we are doing bit operations. Anyway this will be re-factored in a next patch now that is working.
Sorry about this.. i can't remember how many times i changed this line to make this work :P
Comment #29
dagmarTested with Views and Display Suite. It seems to be working fine.
Comment #30
lucascaro commentedcommitted, thanks guys. I think we can close this issue and start a fresh new one for any changes :)
Comment #31.0
(not verified) commentedUpdated issue summary.