Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new14.03 KB

I really like the easy way to migrate this settings.

So here is a patch, please criticize.

dawehner’s picture

StatusFileSize
new14.86 KB

Converted the drush views-dev commando

tim.plunkett’s picture

Issue tags: +VDC

Tagging. At a glance it looks good.

bojanz’s picture

Since 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?

dawehner’s picture

I 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.

merlinofchaos’s picture

I'm happy to simply not use system_settings_form anyway. The convenience isn't worth the opacity, I've found.

dawehner’s picture

Actually the only thing which gets us system_settings_form here is a submit button, there is not problem to remove that.

bojanz’s picture

Yeah, I agree with #6.
We can just kill system_settings_form() and then commit what's here.

dawehner’s picture

StatusFileSize
new17.36 KB

So here is the new patch which removes system_settings_form and adds the buttons and the yml file.

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/drush/views.drush.incundefined
@@ -234,19 +234,22 @@ function views_revert_view($view) {
+    ->set('views_ui_always_live_preview', TRUE)

Shouldn't this be FALSE?

This needs an hook_update_N to migrate the settings, no?

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new17.36 KB

Thanks for spotting that! Here is a new version

There is an update function: views_update_8000()

tim.plunkett’s picture

Status: Needs review » Needs work

Oh I guess I just didn't run it.

+++ b/config/views.settings.ymlundefined
@@ -0,0 +1,23 @@
+views_display_extenders: []

I think that should be views_display_extenders: { }. It was erroring out, so I ran config('views.settings')->set('views_display_extenders', array())->save(); manually from devel and that's what it produced.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new18.06 KB
Oh I guess I just didn't run it.

I had no problem when changing something in the ui in general, did you had problems with that?

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

With the exception of the extra newline at the end of views.settings.yml, this works great. Remove that before committing, please.

dawehner’s picture

Status: Reviewed & tested by the community » Needs work

This definitive needs some rerole after the #states.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new17.4 KB

Rerolled based on latest changes.

bojanz’s picture

Looks like this is ready to go. It is missing the YAML file again though.

dawehner’s picture

StatusFileSize
new16.18 KB

I'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 :)

damiankloip’s picture

Status: Needs review » Reviewed & tested by the community

Just tested this, works great! looks good to go to me.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for testing the patch, so committed to 8.x-3.x

aspilicious’s picture

Status: Fixed » Needs review
StatusFileSize
new11.88 KB

This broke a lot of stuff :)
This kinda patches need a "grep review" before committing ;)

aspilicious’s picture

StatusFileSize
new11.83 KB

New version small fix and fixed a test

dawehner’s picture

StatusFileSize
new4.8 KB

Just a start of the tests, some of them are failing, which is good.

dawehner’s picture

Title: Convert views settings to config » Write tests for views settings
Status: Needs review » Active
Issue tags: +Needs tests
+++ b/tests/views_translatable.testundefined
@@ -54,6 +54,8 @@ class ViewsTranslatableTest extends ViewsSqlTest {
+    debug(get_class($view->localization_plugin));

Removed the debug statement before committing. Thanks!

The review looked perfect and this fixes the broken tests from above.

Update title of the issue

aspilicious’s picture

Title: Write tests for views settings » Convert views settings to config
Status: Active » Needs review
Issue tags: -Needs tests
+++ b/lib/Drupal/views/Tests/UiSettingsTest.phpundefined
@@ -0,0 +1,144 @@
+    // Configure to not always show the master display.
+    // If you have a view without a page or block the master display should be
+    // still shown.
+    $view['page[create]'] = FALSE;
+    $this->drupalPost('admin/structure/views/add', $view, t('Continue & edit'));
+
+    $this->assertLink(t('Master'));

This 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.

aspilicious’s picture

StatusFileSize
new5.37 KB

This 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...

aspilicious’s picture

StatusFileSize
new1.95 KB

Another problem, the upgrade path stuff is changed in core you *need* to define the entire mapping array.

dawehner’s picture

This was so simply stupid function to use, well nevermind, lets get this in, tests are still open.

Thanks!

tim.plunkett’s picture

Should the views ui settings be separate from views? Since they are two modules.

aspilicious’s picture

If the variables are only used by the views UI. Than yes :).
But we need to place the UI module first in a seperate folder.

merlinofchaos’s picture

IMO no, they should not be separated.

aspilicious’s picture

merlin any reason not to seperate? Besides personal preference.

merlinofchaos’s picture

The 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).

dawehner’s picture

StatusFileSize
new4.86 KB

Here are some more tests...

Pedro Lozano’s picture

StatusFileSize
new5.17 KB

Just a fix for one of the test that fails in the last patch.

manuel garcia’s picture

Status: Needs review » Reviewed & tested by the community

The patch applied fine, and I could run the test, and everything looked greenish:

96 passes, 0 fails, 0 exceptions, and 36 debug messages

Pedro Lozano’s picture

This is the ViewsAnalyze test.

dawehner’s picture

I'm wondering whether we should continue to write more tests, they are certainly not complete.

Pedro Lozano’s picture

Here it is the Glossary test.

damiankloip’s picture

Status: Reviewed & tested by the community » Needs work

Don't we want the tests in #37 and #39 in the same patch?

Pedro Lozano’s picture

Actually, those patches belongs more to the "convert to PSR-0" issue than this about the config.

damiankloip’s picture

Is there an issue for it? If so, shouldn't they be on there? :)

Pedro Lozano’s picture

damiankloip’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Fixed

Lets get the tests in and do all the other patches at different places.

tim.plunkett’s picture

Status: Fixed » Needs review
StatusFileSize
new551 bytes

Missed one (my least favorite setting!)
There are no other calls to config() in that function, hence the direct call.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

perfect!

Automatically closed -- issue fixed for 2 weeks with no activity.