- Issue created by @jcandan
- Status changed to Needs review
over 1 year ago 2:14pm 14 June 2023 - ๐บ๐ธUnited States jcandan
This patch removes the controller, route, and link task (contextual link, user profile tab). These are all replaced by the updated View configuration.
- ๐บ๐ธUnited States jcandan
Accidentally included a project specific change in #2. Re-rolled.
- Status changed to Needs work
over 1 year ago 2:39pm 14 June 2023 - ๐บ๐ธUnited States jcandan
Patch #3 doesn't apply the same permission rules. Need to specify a views permission handler that allows view access for owners and those with "access others bookmarks" permissions.
- ๐บ๐ธUnited States jcandan
Also needs to add the title on the default display.
display: default: ... display_options: + title: Bookmarks
- ๐ฎ๐ณIndia arpitk
Updated patch to include default view default display title.
- ๐บ๐ธUnited States jcandan
After some digging, to replace the access checks removed, this patch's view is going to need the following permissions checks:
access others bookmarks
- Current user is viewing own bookmarks list
- Merge request !6Draft: Issue #3366545: Fix Bookmarks view is missing a display โ (Open) created by jcandan
- Status changed to Needs review
5 months ago 12:11pm 12 July 2024 - ๐บ๐ธUnited States jcandan
I was able to solve the views access constraint noted in #7.
It still needs a hook update for the views changes. For now, I pushed this patch and MR up to get community feedback.
Anyone applying this patch wanting to adopt the views config changes may run the following:
cat web/modules/contrib/bookmarks/config/optional/views.view.bookmarks.yml | lando drush config:set --input-format=yaml views.view.bookmarks ? -
- ๐บ๐ธUnited States jcandan
I guess I need to update the target branch. Considering there will be a
hook_update_N()
, this should bump minor version from 1.0.x to 1.1.x, right? - ๐บ๐ธUnited States jcandan
I'd also like to rename the Views Access plugin.
- ๐บ๐ธUnited States jcandan
We've adopted patch #12 to a production project, I am happy to place this to RTBC; however, I am chewing on whether this needs a hook update for the
veiws.view.bookmarks
changes and whether this would need a major, minor, or patch version bump.Obviously, the fix is adopted for any new install. But, for this fix to apply to existing installations would override their existing Bookmarks view--this could be considered a breaking change requiring a major version bump.
The way we applied the change was to simply import the single updated configuration from this module, and then used git to help us track which changes we wanted to keep:
cat web/modules/contrib/bookmarks/config/optional/views.view.bookmarks.yml | drush config:set --input-format=yaml views.view.bookmarks ? -
I imagine we could just bump the patch version and include this instruction in the release notes.
So, the above boils down to, either we:
- Include a hook update and bump the major version.
- Include the single config import instructions in the release notes and bump the patch version.
Opinions welcome.
- ๐บ๐ธUnited States jcandan
As we consider this, these resources may help with development:
- ๐บ๐ธUnited States jcandan
Leaving this one last note here for if we do decide to go with a hook update.
function bookmarks_update_VERSION() { $config_factory = \Drupal::configFactory(); $view = $config_factory->getEditable('views.view.bookmarks'); if ($view->get('display.default.display_options.access.type') != 'bookmarks_view_access') { $view->set('display.default.display_options.access.type', 'bookmarks_view_access'); $view->set('display.default.display_options.title', 'Bookmarks'); ... $view->save(); } }
- ๐บ๐ธUnited States jcandan
This also solves a previously hidden views permissions issue which prevented non-admin users from seeing the links and title fields reported at ๐ Fix bookmark link not shown for non-admin users Fixed #8 ๐ Fix bookmark link not shown for non-admin users Fixed .
- ๐บ๐ธUnited States jcandan
Still awaiting community feedback on options 1 or 2 noted in #13. ๐ Fix Bookmarks view is missing a display Needs review
- ๐บ๐ธUnited States jcandan
If it really is a breaking change, that warrants a major bump. But, Iโm beginning to think it is not a breaking change. The controller and route were in place because the view had not controlled that without a page display. With this change, it does. It also shifts access control to the view with a new view access plugin. So, all the update is confined to the one view.
With a hook update, we could override any customizations they may have made to the view. Without the hook update, if they donโt run the view update
config:set
, they wonโt get the changes and itโll break.Iโm of the opinion that if they customize a module-provided view, any config changes upon update is thereโs to deal with.
That said, Iโm for a minor update to 1.1.0 and a hook update to close out this ticket.