In Drupal 7 this used to work so I am assuming it is something not yet applied to Drupal 8 version or maybe the function has been changed intentionally.

If you add "Link to edit Content" as a field to a view (block or page display) to allow admin users to easily find and and edit each listed item, the view is no longer publicly visible. The access permissions are still as default set to "view published content", and the view is publicly visible without this field added.

This was something that was very useful for views like sliders where the content is not otherwise easily found in order for admins to edit.

In Drupal 7 the "edit" link was only seen by users with permission to edit the node, so the field was not public, but the rest of the view was public.

Is this something that is likely to be possible in future, or does anyone know of a workaround?

Thanks

Comments

gsquirrel created an issue. See original summary.

Lendude’s picture

Status: Active » Postponed (maintainer needs more info)

If I understand correctly, you would want the View to not be accessible to people without node edit permissions if the 'Edit link' field is shown?

This doesn't work in D7 either, and really doesn't sound like expected behaviour.

And like D7 , in D8 the 'edit' link is only shown if you have the right permissions.

You say the behaviour you are looking for works in D7, so could you provide some basic steps to reproduce the behaviour you are looking for?

gsquirrel’s picture

No that is not what I meant.

I want the view to be visible to everyone, as it would be in D7, where the only thing hidden is the edit link.

It might be the same for any individual field in a view that the current user does not have permission to see, I am not sure. In D7 that field ONLY would be hidden from view, the rest of the view would be seen as usual whether logged in or not.

So to recreate you make a new view, unformatted list type showing "fields" not teaser/full.
You add "title" as a field and any others you want.

At this stage the view is visible to all.

You add the field "Link to edit content" to the list of fields to be shown.

Now the view disappears completely unless you are logged in(with permission to edit node), also there is no explanation, so took me a while to realise that was why it disappeared.

Thanks for response, maybe this is not something other people use.

For now my workaround is not to use "fields" but teaser view where there are contextual links.

echoz’s picture

Category: Feature request » Support request

@gsquirrel I'm using edit links on D8 views as I did in D7, and they work as expected. The view is fine when logged out. Something else must be causing your view to become not visible to anon users.

Version: 8.3.3 » 8.3.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.3.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
cilefen’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

I am closing this support request because there have been no recent comments.

The Drupal Core issue queue is not the ideal place for support requests. Consider other sources of support.