In D7, the views listing used tokens for the enable/disable AJAX links. Those got lost somehow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
3.64 KB
967 bytes

Here we go.

dawehner’s picture

+++ b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.phpundefined
@@ -164,25 +164,29 @@ public function reportPlugins() {
+    if (drupal_valid_token($request->query->get('token'), $op)) {

Other places like the OverlayController throw a 403 exception if the token is not valid.

damiankloip’s picture

+++ b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.phpundefined
@@ -164,25 +164,29 @@ public function reportPlugins() {
+    if (drupal_valid_token($request->query->get('token'), $op)) {

As dawehner mentioned above, I tihnk we should throw an error code response here.

Otherwise this is looking pretty good really.

dawehner’s picture

Status: Needs review » Needs work

So, we agree.

damiankloip’s picture

Absolutely

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
2.85 KB
3.23 KB

Indubitably

dawehner’s picture

Status: Needs review » Needs work
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.phpundefined
@@ -164,12 +165,20 @@ public function reportPlugins() {
+   * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
    */

Let's also describe when this exception is thrown.

+++ b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.phpundefined
@@ -182,7 +191,7 @@ public function ajaxOperation(ViewStorageInterface $view, $op, Request $request)
     return new RedirectResponse(url('admin/structure/views', array('absolute' => TRUE)));

Just as a side-node, we could already use the urlgenerator->generate() method directly. (Feel free to open a new issue for it)

tstoeckler’s picture

Priority: Normal » Critical

Pretty sure this is critical, as it's security-related. (And also a regression, apparently.)

damiankloip’s picture

Status: Needs work » Needs review
FileSize
2.89 KB
4.9 KB

Let's do this then.

Status: Needs review » Needs work

The last submitted patch, 2042487-9.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
FileSize
706 bytes
4.91 KB

Oops

dawehner’s picture

It seems to be that the patch is missing a test which ensures that enable/disable via UI actually works.

damiankloip’s picture

Doesn't Drupal\views_ui\Tests\DefaultViewsTest already test this stuff? That enables and disables views in the UI. That test should probably be broken out somehow, but not here.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

OH i am sorry, and confused this up with the other test class called "DefaultViewsTest"...

damiankloip’s picture

Yeah, we named that one really really well! :)

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

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