Let's assume you have a node view. Then add a relationship to user, and add the user: uid argument.
Once you have done this you get the following nice error:
( ! ) Fatal error: Call to a member function getArgumentText() on a non-object in /var/www/d8/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php on line 165
Call Stack
There are several reasons for that:
- To get always a required relationships we try to guess the relationship, and then force a change of the view in the tempstore
- This currently acts on the actual objects, so any changes in there reflects back to the original value, let's clone that
- To be honest in this case we should actually not try to guess the relationship because we know the right one already.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 1877114-13.patch | 5.39 KB | damiankloip |
| #11 | 1877114-10.patch | 5.56 KB | damiankloip |
| #9 | interdiff.txt | 1.08 KB | damiankloip |
| #8 | 1877114-8.patch | 5.56 KB | damiankloip |
| #7 | 1877114-7.patch | 5.66 KB | damiankloip |
Comments
Comment #1
dawehnerThis at least fixes the failure.
Comment #2
dawehnerSo views doesn't really know relationships when adding an item, so it set up the right relationship on first time visiting the config item form. Even this seems to be fundamentally wrong, let's fix the general issue first, as it is quite a major bug to not be able to use any kind of handlers with relationships.
Comment #3
tim.plunkettMight as well add a . here
Re-add, views_ui_cache_set(), data loss
I'm not sure that this will work with the PluginBag patch.
Comment #4
dawehnerWill fix the other problems next year :)
Yeah no idea, but I tell you this code fixes the problem. As d7 does something similar like our current code i don't fully understand why we need this.
Comment #5
tim.plunkettFair enough! :)
Comment #6
dawehnerHere is the new version.
Comment #7
damiankloip commentedOk, here is the start of some tests. I have created an ArgumentUI test class. This exposes another issue with the current fix, this is why I'm uploading this now.
Comment #8
damiankloip commentedI think it's the default_display part we don't want, I think we only use this on display plugins nowadays? I might be wrong...
Comment #9
damiankloip commentedThese were removed.
Comment #10
dawehnerThank you for working on that!
Aren't we using t() around the values of submit elements?
Comment #11
damiankloip commentedGood point, this is done everywhere else, although I'm not sure why. I thought this would be similar to assertion messages etc.. as tests are pretty much not translated unless testing translation. oh well :)
Comment #12
dawehnerLet's get this in now, as it's quite a big bug for users.
Comment #13
damiankloip commentedJust removed a couple of rogue lines, still good to go.
Comment #14
tim.plunkettI reviewed this already, and the patch is definitely RTBC.
Comment #16
tim.plunkett#13: 1877114-13.patch queued for re-testing.
Comment #18
tim.plunkett#13: 1877114-13.patch queued for re-testing.
Comment #20
dawehner#13: 1877114-13.patch queued for re-testing.
Comment #21
dawehnerSo we fixed that already in a way better way: #1906794: Using a relationship in the UI fails completly