Steps to reproduce:

  • Install HEAD
  • Edit any view or create a new one
  • Try to create a new views display that is NOT attachment by clicking on the + Add button

Now you'll see the Views UI will default to the attachment display no matter what. Only "Duplicate as..." allows you to get the views display wanted.

Comments

tim.plunkett’s picture

Priority: Critical » Major
Issue tags: +VDC

Thanks for reporting!

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett

git bisecting this now.

tim.plunkett’s picture

tim.plunkett’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new638 bytes

Okay here's the fix, this could use a test.

tim.plunkett’s picture

StatusFileSize
new605 bytes
new1.12 KB

Hmm, I can't get this to fail locally. But manual testing of it fails.

This is an alternate approach to fix it up a level.

dawehner’s picture

Status: Needs review » Needs work

So this technically still needs works?

anavarre’s picture

I originally flagged this issue as critical per https://groups.drupal.org/node/424518 - I don't mind it being major only but how can we thus ensure we won't ship the product without this being fixed?

How about beta target?

webchick’s picture

Priority: Major » Critical
StatusFileSize
new72.47 KB

Coming here from #2299309: Adding a "REST export" Views display adds an "Attachment" display instead. This 90% case functionality is just plain broken, so I agree critical seems appropriate.

What's happening before is $plugins[$id] is a TranslationWrapper object like so:

array(7) {
  ["block"]=>
  object(Drupal\Core\StringTranslation\TranslationWrapper)#514 (4) {
    ["string":protected]=>
    string(5) "Block"
    ["arguments":protected]=>
    array(0) {
    }
    ["options":protected]=>
    array(0) {
    }
    ["stringTranslation":protected]=>
    NULL
  }

Casting it to a string produces just "Block" and makes the link work again.

I guess the first thing I'd ask is why $plugin['title'] is a TranslationWrapper object in the first place; I would imagine most code would (like this code) assume 'title' is, well, a title. ;) Is that something that needs to be fixed even further upstream?

Digging into SimpleTest results, I can confirm that for whatever reason, SimpleTest's browser is *not* hitting this issue:

Block2 display selected

And a debug($this->getUrl()) shows /block_2 as well. Hrm.

tim.plunkett’s picture

Status: Needs work » Needs review
Issue tags: +JavaScript
StatusFileSize
new1002 bytes

AFAICS, this also "fixes" the bug. Which explains why Simpletest passes.

webchick’s picture

Huh. Yep, I confirm that fixes it indeed.

There's a minor UI regression which is that now when you click "Add" you get:

Only local images are allowed.

As opposed to before you'd get:

 Attachment, Block, etc.

That seems like a suitable trade-off for it working, you know, at all. ;) Still though, it might be good to understand how #2244447: Translation of low-level info/annotations leads to circular dependencies broke functionality that's been unchanged since Views 7.x-3.x was first branched. It might allow us to find other instances that are broken too which we haven't found yet.

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Meh. I dunno. Granted, I'm definitely not the savviest JS person around, but I dug into this for another hour and can't figure it out.

Tentatively doing this. I'd still like to ultimately get down to the bottom of this (maybe nod_ or someone else JS-inclined could help?) but a normal follow-up of "regression: Fix Add Add Add on Views UI displays" seems preferable to Views displays not working at all for any JS-enabled browser.

tim.plunkett’s picture

The other fix was equally functional (and probably would fix other bugs), it was needs work only for tests...

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Oh good point. And since the tests would have caught this had the bug not only manifested in JS...

Committed and pushed to #5 to 8.x (the extra assertion doesn't hurt anything). Thanks!

  • webchick committed 090d1b3 on 8.x
    Issue #2294771 by tim.plunkett | anavarre: Fixed Add views display...

Status: Fixed » Closed (fixed)

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