SA-CONTRIB-2015-039 addressed two issues, a redirect and default permissions for disabled views.

It looks like the redirect issue for the break_lock form is resolved here: http://cgit.drupalcode.org/drupal/tree/core/modules/views_ui/src/Form/Br...

A few of the views need to updated, at least the Archive and Glossary are missing access checks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikey_p’s picture

Issue summary: View changes
dawehner’s picture

We originally filled the default permissions issue based upon a public issue in the core issue queue, sadly I can't find it, primarily because
it got unpublished in the meantime.

But yeah for core it would be nice to have a really simple test, note we already have dedicated tests for each default view IMHO.

mikey_p’s picture

Status: Active » Needs work
FileSize
3.46 KB

Fix, but still needs tests.

mikey_p’s picture

Also, not sure if the watchdog and file views wizard plugins should implement some sort of access check. I'd imagine they do, but there's no obvious permission to check for those.

mikey_p’s picture

Confirmed that the watchdog wizard doesn't add any permissions.

webchick’s picture

Issue tags: +VDC, +D8 upgrade path

Tagging. We wouldn't want to recommend early adopters start building D8 sites without this being fixed.

webchick’s picture

Issue tags: +Security

Sorry, one more.

rootwork’s picture

Status: Needs work » Needs review

The last submitted patch, 3: 2426389-views_sa_contrib_2015_039-2.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 5: 2426389-views_sa_contrib_2015_039-5.patch, failed testing.

olli’s picture

Status: Needs work » Needs review
FileSize
5.51 KB
3.34 KB

Added default permission to aggregator_rss_feed.

+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -77,6 +77,7 @@ protected function defaultDisplayOptions() {
+    $display_options['access']['perm'] = 'access content';

missing ['options']

Status: Needs review » Needs work

The last submitted patch, 11: 2426389-views_sa_contrib_2015_039-11.patch, failed testing.

dawehner’s picture

Title: Port SA-CONTRIB-2015-039 to D8 » Port SA-CONTRIB-2015-039 to D8 (views)

adapted the title to find the issue :P

+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -77,6 +77,7 @@ protected function defaultDisplayOptions() {
+    $display_options['access']['options']['type'] = 'access content';

+++ b/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php
@@ -28,6 +28,7 @@ protected function defaultDisplayOptions() {
+    $display_options['access']['options']['type'] = 'access content';

It should be $display_options['access']['options']['perm'] instead.

dawehner’s picture

Just ensured and indeed the other part of the SA is fixed in HEAD:


  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->tempStore->delete($this->entity->id());
    $form_state->setRedirectUrl($this->entity->urlInfo('edit-form'));
    drupal_set_message($this->t('The lock has been broken and you may now edit this view.'));
  }
olli’s picture

Status: Needs work » Needs review
FileSize
5.51 KB
1.37 KB

thank you!

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Perfect. Thank you!

catch’s picture

I'd really like to remove archive, glossary and other random default views from core, could we open a follow-up for this?

Note I asked for this in the original VDC issue #1805996-26: [META] Views in Drupal Core then xjm's reply said it made sense for them to be in contrib #1805996-29: [META] Views in Drupal Core but for some reason that never happened.

dawehner’s picture

I'd really like to remove archive, glossary and other random default views from core, could we open a follow-up for this?

I think they are useful, given that those examples, especially glossary, are really hard to configure for your own.
They are disabled by default anyway.

In case we really want to remove them, they should be just moved to test only views, given that they allow us to have quite some good test coverage than just the simple views like frontpage.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

From #2

But yeah for core it would be nice to have a really simple test, note we already have dedicated tests for each default view IMHO.

idebr’s picture

Assigned: Unassigned » idebr

I'll work on some tests

idebr’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
7.72 KB
4.46 KB
9.97 KB

Added tests for the paths:

  • /aggregator/rss
  • /archive
  • /glossary
  • /taxonomy/term/%
  • /taxonomy/term/%/feed
idebr’s picture

Assigned: idebr » Unassigned

The last submitted patch, 21: 2426389-21.fail_.patch, failed testing.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

The patch and tests look good to me. There's just one thing that stands out a bit:

+++ b/core/modules/views_ui/src/Tests/DefaultViewsTest.php
@@ -108,7 +110,18 @@ function testDefaultViews() {
+    // Clear permissions for anonymous users to check access for default views.
+    $this->config('user.role.' . DRUPAL_ANONYMOUS_RID)->set('permissions', array())->save();

We usually update the config entity instead working with the underlying config system, but it works so I'll let committers decide if it's ok to do this or not.. it's just a test after all :)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

re #24 This makes the test unnecessarily dependent on the underlying config structure. Let's fix that.

amateescu’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
10.15 KB
903 bytes

Ok, that's a very easy fix and shouldn't hold up this patch any longer.

amateescu’s picture

dawehner’s picture

amateescu’s picture

FileSize
10.38 KB

I think #28 was a crosspost with #26 and the new files were accidentally deleted. Trying a re-upload of #27 for the testbot.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 7f6245a and pushed to 8.0.x. Thanks!

  • alexpott committed 7f6245a on 8.0.x
    Issue #2426389 by olli, mikey_p, idebr, amateescu: Port SA-CONTRIB-2015-...
dawehner’s picture

Status: Fixed » Closed (fixed)

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