Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Similar to contextual-links integration we want to be able to render certain links
as a dropbutton.
You want to be able to select certain fields which are rendered as links, and then they should be grouped together as dropbutton.
One day this could be used to have a nice edit experience using admin_views.
Proposed resolution
Provide an integration.
Remaining tasks
-
User interface changes
-
API changes
-
Comment | File | Size | Author |
---|---|---|---|
#24 | 1826604-24.patch | 14 KB | damiankloip |
#24 | interdiff.txt | 9.76 KB | damiankloip |
#20 | vdc-1826604-20.patch | 15.35 KB | tim.plunkett |
#20 | interdiff.txt | 2.71 KB | tim.plunkett |
#18 | vdc-1826604-18.patch | 14.22 KB | tim.plunkett |
Comments
Comment #0.0
dawehnertest
Comment #1
dawehnerIt still looks a bit different compared to the views edit interface, but this seems to be just styled different.
Comment #2
damiankloip CreditAttribution: damiankloip commentedAn abstract, but should we be calling this abstract when it's not abstract, or make this abstract? I guess the second one :)
I think this is meant to be 'Only show fields that precede this one'.
It would also be good good to filter by only fields that can actually render links. This is potentially a good follow up issue, as there currently isn't a nice way to achieve this.
Comment #3
dawehnerYeah, i got confused by that.
Comment #4
dawehnerLet's also add tests.
Comment #5
tim.plunkettI was just manually testing this patch for #1851086: Replace admin/people with a View and it works great!
Why is this an alter and not just a regular info hook?
Don't we do this for tokens as well? We could probably have a helper (follow-up, of course)
We should probably add assertion messages
I think the "Custom Text" should technically be wrapped in t().
Comment #6
dawehnerThanks for the review!!
Well, we use the alter hook, because we add to an (maybe not existing at that point).
But i don't care let's use hook_views_data
Currently there is no translation system for views, so ... but yeah fixed it :)
Comment #8
damiankloip CreditAttribution: damiankloip commentedI think we might want to move this back to hook_views_data_alter() as we are adding this to the views "table"?
Comment #9
dawehnerNoone knows whether it's right to use hook_views_data_alter or hook_views_data when you add to an existing table and in reality it simply doesn't matter.
Comment #11
damiankloip CreditAttribution: damiankloip commentedThe tokens array was being polluted, so we were getting the values returned from getPreviousFieldLabels() twice. Like :
Comment #13
damiankloip CreditAttribution: damiankloip commented#11: 1826604-11.patch queued for re-testing.
Comment #14
tim.plunkettI think this is good to go.
I've manually tested it, and the code changes look great, especially that new helper method.
Comment #15
dawehner#11: 1826604-11.patch queued for re-testing.
Comment #16
tim.plunkettThis is blocking any efforts to port admin listings to Views.
Comment #17
tim.plunkettThough, this needs to be updated for the $testViews approach and #1855228: Move Views core module tests to their respective modules
Comment #18
tim.plunkettPostponed on #1855228: Move Views core module tests to their respective modules
Rerolled for the $testViews
Comment #19
tim.plunkettComment #20
tim.plunkettThis is major because it blocks every single admin view conversion.
Updated for the recent commits, should be back to RTBC if green.
Comment #21
dawehnerThis interdiff looks fine.
Comment #22
damiankloip CreditAttribution: damiankloip commentedYep, looks good to me too.
Comment #23
catchOK so the code in general looks fine, but system module shouldn't know anything about views. Ideally system module shouldn't know about anything at all because it's been shot in the brain.
Comment #24
damiankloip CreditAttribution: damiankloip commentedYep, understood. We can move this back to views.
Comment #25
tim.plunkettOh well that's easier.
Comment #26
dawehnerSo everything which is part of either core/includes or core/lib should get it's views integration in views.views.inc?
Just in general it's a bit odd, because views also implements it's own api, so if you would ask me personally i would like to put the views integration into system.views.inc but i don't care.
Comment #27
catchIf there's something in /includes or core/lib that needs views integration, then that integration should probably go into a new or existing module that's neither system nor views. Same as we just re-added entity module to avoid stuffing things into system.
Eventually /includes shouldn't exist at all - we'll one-day migrate all of that to core/lib or core/modules (although it might take another release or so).
This looks like a generic handler and not related to any particular core subystem so I'm not sure it's a problem here though? Committed/pushed to 8.x but happy to discuss this a bit more.
Comment #28
dawehnerSo for the dropbutton field we could create a system_views, but then we basically end up with a system.views.inc kind of functionality.
It's loaded only when views requests that hooks, so it doesn't add additional costs. So yeah i don't have a real solution/good name idea for that problem.
Comment #29.0
(not verified) CreditAttribution: commentedupdate
Comment #30
AnybodyWill this be backported to Drupal 7 or is there a module to provice dropbutton links in views? This would be very very useful!
Comment #31
AnybodySelf-Answer: See #1608920: Add drop-button field display