Running the latest dev snapshot of Views on D7.2, any time I click on the 'Edit view' contextual menu when a view is displayed it leads to the wrong URL and results in an "Access denied" error. For example, looking at the view "myview", which includes a single "Content pane" display, the "Edit view" link leads to the URL:

This gives an "Access denied" error in the popup. The correct URL should be:

I should also clarify that the view is being displayed within a Panel pane.

CommentFileSizeAuthor
#5 1202048-default_display-redirect.patch753 bytesdawehner

Comments

dawehner’s picture

The more i think about this bug, i guess the original issue: #1127254: Inline "Edit view" dropdown for block view embedded in theme via views_embed_view returns "You are not authorized" error. is not fixed.
But let's fix it here.

dawehner’s picture

There are two places to solve it

* either don't output 'default' in the link
* or allow to use 'default' as path of the url.

The problem is that if you have configured that not "always show the master display" views_ui_edit_page_display_tabs() returns ][default][#access] = false and so on.

So the question is should the user be able to access the default display or should they be redirected to the first other display.
Personally i would say it should be displayed if it's part of the url.

damienmckenna’s picture

I'd vote for the first option, to not include '/default' in the URL.

dawehner’s picture

Status: Active » Needs review

earl suggested to redirect the user.

Here is a patch which works for me. Can you please test it as well?

Additional, is there another way to do it without arg() and drupal_goto?

dawehner’s picture

StatusFileSize
new753 bytes

Here is the patch. Please always comment asap if there is no patch, because this could lead to double work in .patches are removed.

dawehner’s picture

Status: Needs review » Fixed

Commited finally. Thanks for reporting the issue.

damienmckenna’s picture

@dereine: thanks.

Status: Fixed » Closed (fixed)

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