Views provides quite some settings so lets convert them to the config system.
There should be one views.settings yml file which is used for everything under admin/structure/views/settings.
| Comment | File | Size | Author |
|---|---|---|---|
| #46 | views-1602372-46.patch | 551 bytes | tim.plunkett |
| #39 | 1602372-Convert-views-Glossary-test-to-PSR-0.patch | 4.36 KB | Pedro Lozano |
| #37 | 1602372-Convert-analyze-test-to-PSR-0.patch | 9.45 KB | Pedro Lozano |
| #35 | ui-settings-test-2.patch | 5.17 KB | Pedro Lozano |
| #34 | ui-settings-test.patch | 4.86 KB | dawehner |
Comments
Comment #1
dawehnerI really like the easy way to migrate this settings.
So here is a patch, please criticize.
Comment #2
dawehnerConverted the drush views-dev commando
Comment #3
tim.plunkettTagging. At a glance it looks good.
Comment #4
bojanz commentedSince system_settings_form() is used for those, wouldn't it make sense to wait for #1324618: Implement automated config saving for simple settings forms to get done first? Then use the API that gets defined there?
Comment #5
dawehnerI don't care but as this part is already written we could commit that and just wait until the other issues has finished and refactor later. It seems to be that it still needs some time, see last comment of chx, which i actually totally agree with. This should be as easy as possible else people will not use it.
Comment #6
merlinofchaos commentedI'm happy to simply not use system_settings_form anyway. The convenience isn't worth the opacity, I've found.
Comment #7
dawehnerActually the only thing which gets us system_settings_form here is a submit button, there is not problem to remove that.
Comment #8
bojanz commentedYeah, I agree with #6.
We can just kill system_settings_form() and then commit what's here.
Comment #9
dawehnerSo here is the new patch which removes system_settings_form and adds the buttons and the yml file.
Comment #10
tim.plunkettShouldn't this be FALSE?
This needs an hook_update_N to migrate the settings, no?
Comment #11
dawehnerThanks for spotting that! Here is a new version
There is an update function: views_update_8000()
Comment #12
tim.plunkettOh I guess I just didn't run it.
I think that should be
views_display_extenders: { }. It was erroring out, so I ranconfig('views.settings')->set('views_display_extenders', array())->save();manually from devel and that's what it produced.Comment #13
dawehnerI had no problem when changing something in the ui in general, did you had problems with that?
Comment #14
tim.plunkettWith the exception of the extra newline at the end of views.settings.yml, this works great. Remove that before committing, please.
Comment #15
dawehnerThis definitive needs some rerole after the #states.
Comment #16
dawehnerRerolled based on latest changes.
Comment #17
bojanz commentedLooks like this is ready to go. It is missing the YAML file again though.
Comment #18
dawehnerI'm so confused because i actually work in a branch, no idea, so here is a new branch with the yml file, just rechecked it twice :)
Comment #19
damiankloip commentedJust tested this, works great! looks good to go to me.
Comment #20
dawehnerThanks for testing the patch, so committed to 8.x-3.x
Comment #21
aspilicious commentedThis broke a lot of stuff :)
This kinda patches need a "grep review" before committing ;)
Comment #22
aspilicious commentedNew version small fix and fixed a test
Comment #23
dawehnerJust a start of the tests, some of them are failing, which is good.
Comment #24
dawehnerRemoved the debug statement before committing. Thanks!
The review looked perfect and this fixes the broken tests from above.
Update title of the issue
Comment #25
aspilicious commentedThis doesn't make sens at all :D. You're saying you're goin to set the "show always master diplsay" option. But you don't do that.
Comment #26
aspilicious commentedThis still fails but for the correct reasons ;)
That assertLink stuff doesn't work. In the verbose output I can see the link appear and dissapear but it always sthinks there isn't a master link... Stupid assertions...
Comment #27
aspilicious commentedAnother problem, the upgrade path stuff is changed in core you *need* to define the entire mapping array.
Comment #28
dawehnerThis was so simply stupid function to use, well nevermind, lets get this in, tests are still open.
Thanks!
Comment #29
tim.plunkettShould the views ui settings be separate from views? Since they are two modules.
Comment #30
aspilicious commentedIf the variables are only used by the views UI. Than yes :).
But we need to place the UI module first in a seperate folder.
Comment #31
merlinofchaos commentedIMO no, they should not be separated.
Comment #32
aspilicious commentedmerlin any reason not to seperate? Besides personal preference.
Comment #33
merlinofchaos commentedThe UI is a separate module only for the convenience of being able to globally disable the UI. Separating the settings is simply a hassle; the code is barely separate (most of the UI code is in includes/admin.inc for example).
Comment #34
dawehnerHere are some more tests...
Comment #35
Pedro Lozano commentedJust a fix for one of the test that fails in the last patch.
Comment #36
manuel garcia commentedThe patch applied fine, and I could run the test, and everything looked greenish:
96 passes, 0 fails, 0 exceptions, and 36 debug messagesComment #37
Pedro Lozano commentedThis is the ViewsAnalyze test.
Comment #38
dawehnerI'm wondering whether we should continue to write more tests, they are certainly not complete.
Comment #39
Pedro Lozano commentedHere it is the Glossary test.
Comment #40
damiankloip commentedDon't we want the tests in #37 and #39 in the same patch?
Comment #41
Pedro Lozano commentedActually, those patches belongs more to the "convert to PSR-0" issue than this about the config.
Comment #42
damiankloip commentedIs there an issue for it? If so, shouldn't they be on there? :)
Comment #43
Pedro Lozano commented#1637532: [META] Convert existing tests to PSR-0
Comment #44
damiankloip commentedComment #45
dawehnerLets get the tests in and do all the other patches at different places.
Comment #46
tim.plunkettMissed one (my least favorite setting!)
There are no other calls to config() in that function, hence the direct call.
Comment #47
aspilicious commentedLooks good
Comment #48
dawehnerperfect!