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
Flag currently lists Views UI as a dependency. Even if Flag relied on Views (which it doesn't) there's no reason to depend on Views UI.
Proposed resolution
Remove the Views UI dependency.
Remaining tasks
Create patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#10 | flag_remove_views_ui_dependency-2564085-10.patch | 2.98 KB | emclaughlin |
| |||
#5 | 2564085.2.removeViewsUIdep.patch | 339 bytes | latikas |
#5 | interdiff.txt | 339 bytes | latikas |
#2 | 2564085.1.removeViewsUIdep.patch | 219 bytes | socketwench |
Comments
Comment #2
socketwench CreditAttribution: socketwench as a volunteer commentedComment #4
martin107 CreditAttribution: martin107 commentedI was looking at the module dependencies just before I saw this .... I hope it is alright to merge in my separate concerns...
I think we need to add a dependency on the user module.
It is strange to think of user not being a core function - I cannot conceive of a drupal site without the user module.... so this is a corner case only.
Here is why I think we depend on the user module.
1) We have reference to \\Drupal::currentUser and $this->currentUser in Flag.php and FlagService.php
2) Searching the module for \Drupal\user\ shows that we have a testing dependency [ This only show *test.php files ]
I am not sure why the tests are failing ... I will have time to look tomorrow.
Comment #5
latikas CreditAttribution: latikas commentedComment #7
martin107 CreditAttribution: martin107 commentedAh that is interesting .....
When I look at the root - common to all the errors.
A route which is defined in views_ui ( see views_ui.routing.yml )
So the views_ui dependency is buried in the code....
So I think that aspect of the issue is "Closed works as designed"
The remaining thing to review is a side issue
Should we make explicit the dependency on the user module?
Comment #8
joachim CreditAttribution: joachim commentedIt's buried in our help texts:
> 95: $output .= t('Lists of flagged content can be displayed using views. You can configure these in the Views administration section.', ['@views-url' => Url::fromRoute('entity.view.collection')->toString()]);
97: $output .= ' ' . t('Flag module automatically provides a few default views for the bookmarks flag. You can use these as templates by cloning these views and then customizing as desired.', ['@views-url' => Url::fromRoute('entity.view.collection', ['query' => ['tag' => 'flag']])->toString()]);
Where it's probably not necessary -- Views is part of core anyway, and even as far back as D6 everyone knows how to use Views to make lists of things. This help text was probably written in D4.7 days or something...
Comment #9
socketwench CreditAttribution: socketwench as a volunteer commentedYeesh, yeah, it's old. I suggest we consider updating the text on that page or just remove it completely.
Comment #10
emclaughlin CreditAttribution: emclaughlin at Genuine commentedThis has been bothering me, since we don't allow views_ui to be enabled on prod sites but need to use flags, too. Glad someone already made an issue for it! Here's an updated patch where I remove the links to the Views UI route from the three places they appear in.
Comment #11
joachim CreditAttribution: joachim commentedCommitted. Thanks!