Updated: Comment #N

Problem/Motivation

Steps to reproduce:
Go to /admin/structure/views
Click "Enable" for one of the disabled views

Expected
After a throbber, the view will move to the "enabled" table and if its a page view, will be immediately available
Actual
After a throbber, nothing will happen. Trying to visit the page view will 404.

This is because the view attempts to initialize all arguments, some of which require the request.
Since the rebuild is triggered during the KernelEvents::TERMINATE event, the request is not available

Proposed resolution

The actual instantiated arguments are not needed, just their IDs.
Retrieve those directly

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
1.8 KB

This was triggered by #2095959: Remove instances of menu_get_object('node') and #2164367: Rebuild router as few times as possible per request

I have no idea how to test this, since it seems Simpletest skips the terminate event completely.

The other deletions were dead code, as flagged by PHPStorm.

Status: Needs review » Needs work

The last submitted patch, 1: vdc-2230055-1.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
2.66 KB

My fault for not running the unit tests locally.
I looked around, and we've casted this in other places. Should be fine.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Looks great to me!

dawehner’s picture

For me too. This is a great cleanup as well.

  • Commit a7fccaa on 8.x by catch:
    Issue #2230055 by tim.plunkett: Views handlers should not be initialized...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Nice find. Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

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