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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

socketwench created an issue. See original summary.

socketwench’s picture

Status: Active » Needs review
FileSize
219 bytes

Status: Needs review » Needs work

The last submitted patch, 2: 2564085.1.removeViewsUIdep.patch, failed testing.

martin107’s picture

I 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.

latikas’s picture

Status: Needs work » Needs review
FileSize
339 bytes
339 bytes

Status: Needs review » Needs work

The last submitted patch, 5: 2564085.2.removeViewsUIdep.patch, failed testing.

martin107’s picture

Ah that is interesting .....

When I look at the root - common to all the errors.

Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "entity.view.collection" does not exist."

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?

joachim’s picture

It'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...

socketwench’s picture

Yeesh, yeah, it's old. I suggest we consider updating the text on that page or just remove it completely.

emclaughlin’s picture

Status: Needs work » Needs review
FileSize
2.98 KB

This 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.

joachim’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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