Problem/Motivation

It's not possible to load a view with a disabled display from YAML or to disable a view display and then save the view, as the display schema lacks the enabled key.

Proposed resolution

Update the display schema to add the enabled key.

Remaining tasks

User interface changes

None.

API changes

None.

Comments

larowlan’s picture

StatusFileSize
new516 bytes

something like this?

cafuego’s picture

Assigned: Unassigned » cafuego

Yup, something like that. Cheers :-)

cafuego’s picture

Status: Active » Needs review
StatusFileSize
new10.07 KB
new8.68 KB

The last submitted patch, 3: 2410539-disabled-display-schema-3.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 3: 2410539-disabled-display-schema-3-testonly-mustfail.patch, failed testing.

cafuego’s picture

Status: Needs work » Needs review
StatusFileSize
new10.74 KB
new9.36 KB

'ave another go.

The last submitted patch, 6: 2410539-disabled-display-schema-6.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 6: 2410539-disabled-display-schema-6-testonly-mustfail.patch, failed testing.

cafuego’s picture

Status: Needs work » Needs review
StatusFileSize
new10.88 KB
new9.5 KB

larowlan++

Another go, with fixed up tests.

Status: Needs review » Needs work

The last submitted patch, 9: 2410539-disabled-display-schema-9-testonly-mustfail.patch, failed testing.

cafuego’s picture

Title: Views schema prevents saving of view with disabled display though code » Views schema prevents saving of view with disabled display through code
gábor hojtsy’s picture

+++ b/core/modules/views/config/schema/views.display.schema.yml
@@ -18,6 +18,9 @@ views.display.page:
   mapping:
+    enabled:
+      type: boolean
+      label: 'Status'

Why add this on each view config one by one instead of on the views_display base definition?

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB
new10.02 KB

Ok let's try this.

jibran’s picture

StatusFileSize
new741 bytes
new9.99 KB

Now with the correct tested fix. This should be green.

The last submitted patch, 13: 2410539-disabled-display-schema-13.patch, failed testing.

kattekrab’s picture

Status: Needs review » Reviewed & tested by the community

nicely done. RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 63ef606 and pushed to 8.0.x. Thanks!

diff --git a/core/modules/views/src/Tests/Plugin/DisabledDisplayTest.php b/core/modules/views/src/Tests/Plugin/DisabledDisplayTest.php
index 89549d7..4cfce8c 100644
--- a/core/modules/views/src/Tests/Plugin/DisabledDisplayTest.php
+++ b/core/modules/views/src/Tests/Plugin/DisabledDisplayTest.php
@@ -39,10 +39,10 @@ protected function setUp() {
   }
 
   /**
-   * Tests that views didsplays can be disabled.
+   * Tests that views displays can be disabled.
    *
    * This method only checks the page displays via a HTTP request, but should
-   * the .enabled property disppear from the schema both the load and save
+   * the .enabled property disappear from the schema both the load and save
    * calls will start failing.
    */
   public function testDisabledDisplays() {

Fixed spelling mistakes on commit.

  • alexpott committed 63ef606 on 8.0.x
    Issue #2410539 by cafuego, jibran, larowlan: Views schema prevents...

Status: Fixed » Closed (fixed)

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