Problem/Motivation
In #1966424: Change notice: Allow Views handlers to be optional we allowed handlers to be denoted as optional, so that if their providing module was broken, the Views UI would still function.
When a missing handler is optional, we should provide better UI text.
Proposed resolution
Now people see "broken handler" but have no context at all, so let's show them the information we know
- The missing plugin
- The missing module
One important bit is that we have to show the information as fast as possible, because a broken handler is a clear sign that something is seriously broken (as indicated). Hiding information causes problems on the longrun.
Related Issues
This is blocked on #1825896: Add module owner to plugin data on handlers and is part of #1822048: Introduce a generic fallback plugin mechanism
Original report by [username]
(Text of the original report, for legacy issues whose initial post was not the issue summary. Use rarely.)
| Comment | File | Size | Author |
|---|---|---|---|
| #51 | 2016953-51.patch | 29.9 KB | damiankloip |
| #51 | interdiff-2016953-51.txt | 21.32 KB | damiankloip |
| #51 | 2016953-51.png | 40.92 KB | damiankloip |
| #48 | 2016953-48.patch | 28.23 KB | damiankloip |
| #48 | interdiff-2016953-48.txt | 8.03 KB | damiankloip |
Comments
Comment #1
tim.plunkettWell #1825896: Add module owner to plugin data on handlers will allow us to make this more helpful, but we can start making progress first.
Comment #2
tim.plunkettComment #4
tim.plunkettDifferent approach. Interdiff was useless.
Comment #5
dawehnerCan't we pull in the plugin ID here?
Comment #6
tim.plunkettAt this point the plugin ID is 'broken'. We could pass more information in the $manager->createInstance('broken') call, but I that's not specific to optional ones, and we should fix that in the bigger broken issue.
Comment #7
dawehnerLet's write a test for it.
Comment #9
dawehnerThis could fix it (together with the missing yml files).
Comment #10
damiankloip commentedI think we should still try to get #1825896: Add module owner to plugin data on handlers in first, so we can add the module dependency with this too. This would be a bit more useful I think, at the moment we are just displaying a different generic message.
Comment #11
dawehnerSo
Comment #12
damiankloip commentedI resumed progress on linked issue in #10
Comment #13
tim.plunkettRerolled, but it needs an update now that #1825896: Add module owner to plugin data on handlers is in
Comment #14
jibranComment #15
dawehnerLet's try to leverage as many information as possible and present them to the user.
Comment #16
xjmAgreed @dawehner, that will make it easier for people to debug.
This has a usability impact, because telling people Drupal is broken right after they install is a WTF.
Comment #17
xjm'Cause it's Views.
Comment #18
dawehnerThank you for treating people different, every patch should have a manual testing flag tbh.
Comment #19
tim.plunkettUndefined index: provider in Drupal\views\Plugin\views\field\Broken->adminLabel() (line 23 of core/modules/views/lib/Drupal/views/Plugin/views/field/Broken.php).ViewsHandlerManager::getHandler() passes through $item, but it doesn't seem to always have the provider key set.
Comment #20
damiankloip commentedGave this a test run, works as expected. Just a couple of things:
- The replacement for @field was wrong though ('@Field')
- The content translation link just didn't have a provider key in its default config
- Also, I think we should add an isOptional() method; then people can determine this with other logic. Rather than having to add this to their configuration (we could even look at that, although might involve checking is a module exists :/)
Comment #22
damiankloip commentedForgot to fix the test string too.
Comment #23
dawehnerHa. I think this is ready to fly now.
Comment #24
xjmManually tested and it works fine. Screenshots attached.
I think we might want a usability review here, though. It's a lot of text. Not bumping back to NR; I'll let a maintainer make that call if the UX team doesn't get to it first.
Before patch
After patch
Modal you get when clicking the link (unchanged)
Comment #25
xjmSeriously, d.o.
Comment #26
webchickHm. This makes the message a lot longer and more technical than it was before. I'd expect it to just say "Optional handler missing" and not expose the technical details unless I clicked on it to reveal more.
Tossing back to needs review for a moment to see what the stance is from the UX team on that.
Comment #27
xjmThe specifics of which module etc. provides the hander are very valuable; I wonder if it would make sense to put them on the modal you get when you click the link, or reveal them in another way?
Comment #28
dawehnerAdded an issue summary adressing some points ... Note the part about hiding. If you are scared about the message then it is the best thing we could have achieved ... a broken handler is a sign of a problem, so people will deal with it fast.
Comment #29
webchickRight, but normally we indicate problems with yellow/red backgrounds, warning icons, and the like. Not with one table row mysteriously 3 lines high vs. the one row high that everything else surrounding it is.
I agree the extra debugging info is valuable, I would just put it behind a click. Else my eye's going to have to hit that extraneous info every single time I tweak the content view throughout the life of my site, even if I never, ever intend to make my site multilingual.
Comment #30
tim.plunkettCan we compromise and do "Overridden @module handler is missing" and have the field/table in the modal?
Comment #31
webchickI would be fine with that, yep. Might want to get the opinion of the UX team.
Comment #32
xjmI agree that the module name is the most important information. Most likely scenario is "Oh, this is because I uninstalled Foo module."
I realize I forgot to note that the screenshots in #24 are editing
admin/content, in HEAD, on a fresh installation. We don't want the user to be scared about that; that's half the point of this issue.I deliberately "broke" the field handler for the content type (by deleting it) to see what it would look like:
Comment #33
damiankloip commentedIs the screenshot from an older patch? As the field token is not correctly replaced. This should be fixed from #21/#22.
Comment #34
dawehnerIs there any way how we could indicate the user to click on the link, because otherwise the issue is kind of pointless, as said often.
... Hopefully this works.
Comment #35
xjmLet's get some help from the UX team. The issue is tagged so it's just a matter of waiting for their input. :)
Comment #36
xjm@damiankloip, it was the patch from #22.
Comment #38
tim.plunkettWe also have to revert http://drupalcode.org/project/drupal.git/commitdiff/5de3941. If we do that here, we can close #1822048: Introduce a generic fallback plugin mechanism.
Comment #39
damiankloip commentedBut the image in #32 has no it had the field token replaced, and I'm pretty sure the patch in #22 fixed that. Its not a bid deal though :-) easily fixed.
Comment #40
dawehnerLet's not fix the test failures until someone decides how it should look like.
Comment #41
Bojhan commentedSorry for getting to this issue so late, sadly few people watch that tag. I agree with @webchick here that we should omit the message from initial view. Since its likely this will wrap several lines, it will negatively impact scanability.
I understand the concern, that people might not click this - adding ellipses as suggested will solve this. I also suggest moving the error message from the title to the actual body (the modal redesign, should solve some of the visibility issues there).
The error message should read something like :
Ideally the suggestions are a little less silly.
Comment #42
Bojhan commentedRemoving tag
Comment #43
dawehnerGreat feedback!
Comment #44
dawehnerTesting strings is sooooo annoying.
The tests aren't adapted yet
Comment #45
damiankloip commentedComment #47
damiankloip commentedRerolling and working on this
Comment #48
damiankloip commentedChanged a few things, ViewEditFormController was not using the conditional code it had for broken handlers properly. changed the test_view_optional yaml file, and a few other things.
Oh, and the first drupalGet() in each test method needed to move inside the foreach() otherwise we only get the first link.
Didn't add any assertions for the body text. I think asserting the whole text is totally nuts, we could just check the tokens have been replaced correctly maybe, what do you think?
Comment #49
dawehnerdamiankloip++
HAHA
Why do we need one drupalGet foreach handler type?
Comment #50
damiankloip commentedBecause atm there is another drupalGet for the actual config item form within the loop.
Comment #51
damiankloip commentedOk, I've made a few more changes to this...
Let's please get this in sooner rather than later, I (we) don't want endless iteration and bikeshedding on the exact text here, there is other useful stuff contained in this patch that would be good to get in. If some one wants to open an issue to talk about the exact text in detail, that could be an easy follow up issue?
I have changed the form description markup to use a render array, as well as adding an item list for the info too.
I've also attach a screenshot of a current example when this patch is used.
Comment #52
Bojhan commentedThe text looks fine to me now, I dont think its bikeshedding at all. These are very actual improvements to the usability of that text.
Comment #53
damiankloip commentedGreat, glad it seems ok. That came across wrong maybe; I just meant that if we wanted alot more time to discuss the text, it should move to it's own issue (potential bikeshedding, not previously in the issue). It seems you're happy with this too though :)
Comment #54
tim.plunkettI think the text is great, I'm glad @Bojhan agrees!
From a technical standpoint this patch is solid.
Comment #55
webchickOk great. My earlier feedback is now resolved by making the overview table say:
or else:
Clicking on those gives you all the juicy details you could want. And since no other table rows use the ellipsis, hopefully that will entice people to click them and see what's what.
Committed and pushed to 8.x. Thanks!
Comment #56
damiankloip commentedNice, thank you!
Comment #57.0
(not verified) commentedadded issue summary