Problem/Motivation
The Mapillary admin listings (Sequences, Images, Organizations, Map Features, Detections) live under /admin/content/mapillary, but on a site without admin_toolbar there is no link to them anywhere in the admin UI. They can only be opened by typing the URL.
The only way in today is the menu link mapillary.content (parent system.admin_content) and its children in mapillary_entity.links.menu.yml and the submodules. That works with admin_toolbar, which renders the children of Content as a dropdown. It does not work with the core admin UIs:
- The Navigation module removes
system.admin_contentand everything under it from the admin menu tree (NavigationHooks::navigationMenuLinkTreeAlter()) and shows its own Content links instead. The Mapillary links disappear with it. /admin/contentshows its sibling listings (Blocks, Comments, Files, Media) as local tasks withbase_route: system.admin_content. The module defines no such local task, and every Views page display (views.view.mapillary_*,page_1) hasmenu: type: none.- The overview page
/admin/content/mapillary(mapillary_entity.content.overview) is reachable only through the same menu link.
The listing pages also have no action button. The entity types have no add-form link template on purpose: entities are imported from the Mapillary API, not created by hand (see the Permissions section of the README). But the listings offer no import either:
- Sequences and Images can only be imported through the reference field widgets on a host entity (
MapillaryImageImporter::import()andimportSequence()). - The Detection import form exists (
mapillary_detection.import,/admin/content/mapillary/detections/import, which also imports Map Features by ID), but nothing links to it: no local action, no menu link.
So an editor who opens a listing sees an empty table and no way to fill it from there.
Steps to reproduce
- Install Drupal 11.4 with the Standard profile (Navigation enabled,
admin_toolbarnot installed). - Enable
mapillary_entityandmapillary_organization. - Open
/admin/content: the tabs are Content, Blocks and Files; there is no Mapillary tab. The Navigation sidebar has no Mapillary entry either. - Open
/admin/content/mapillary/sequencesby URL: the View renders, with no tabs and no action button. The same holds for/admin/content/mapillary/imagesand/admin/content/mapillary/organizations. - With
mapillary_detectionenabled,/admin/content/mapillary/detectionshas no link to the import form.
Proposed resolution
Follow the core pattern for listings under Content (Blocks, Comments, Files, Media): local tasks and local actions, independent of the toolbar in use. Keep the existing menu links for admin_toolbar users.
Local tasks
- In
mapillary_entity.links.task.yml: a primary tab "Mapillary" on/admin/content(base_route: system.admin_content), pointing toview.mapillary_sequences.page_1. - Secondary tabs under it (
parent_id), one per listing: Sequences and Images inmapillary_entity, Organizations inmapillary_organization, Map Features inmapillary_map_feature, Detections inmapillary_detection, each pointing to itsview.mapillary_*.page_1route. Corecomment.links.task.ymluses the same primary/secondary layout undersystem.admin_content.
Local actions
- "Import detections" on the Detections and Map Features listings, pointing to the existing
mapillary_detection.importroute (mapillary_detection.links.action.yml). - "Import sequence" and "Import image" forms in
mapillary_field, which already holdsMapillaryImageImporter: a single Mapillary ID field, callingimportSequence()(cascade disabled, images queued as the field widget does) orimport(), then redirecting to the imported entity. Linked as local actions on the Sequences and Images listings, and shown only whenmapillary_fieldis enabled. - Access as the listings: the admin permission of the entity type.
Out of scope
- An add form for manual entity creation. The entity types stay import-only.
- Organizations: there is no importer to link to.
- The parallel entity list builder routes (
entity.mapillary_*.collection,/admin/content/mapillary/sequenceetc.).
Remaining tasks
- Add the local tasks in each module's
links.task.yml. - Add the Detection import local actions.
- Add the Sequence and Image import forms, their routes and local actions.
- Functional tests, with Navigation enabled and
admin_toolbarabsent: the Mapillary tab on/admin/content, the secondary tabs of each enabled submodule, each local action and its access. - Kernel or Functional tests for the import forms: a valid ID imports and redirects, an unknown ID shows the existing error and creates nothing.
- README and CHANGELOG.
User interface changes
- New "Mapillary" tab on
/admin/content, with secondary tabs for each listing. - New import buttons on the Sequences, Images, Map Features and Detections listings.
- New Sequence and Image import forms.
API changes
- None. New routes and form classes only.
Data model changes
- None.
Issue fork mapillary-3629073
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
orkutmuratyilmaz