bug: #3629073: Mapillary listings have no tabs or import actions without admin_toolbar

Issue: https://www.drupal.org/project/mapillary/issues/3629073

Problem

Without admin_toolbar, the Mapillary listings under /admin/content/mapillary were only reachable by typing the URL. The core Navigation module removes system.admin_content and its children from the admin menu tree, so the mapillary.content menu links never show. There were also no local tasks on /admin/content, and no import actions on the listings.

Changes

  • Tabs: a "Mapillary" local task on /admin/content (base_route: system.admin_content), with secondary tabs for Sequences, Images, Organizations, Map Features and Detections. Each tab is defined in its own module, so it only shows when that module is enabled. The menu links are kept for admin_toolbar users.
  • Import forms: MapillarySequenceImportForm (/admin/content/mapillary/sequences/import) and MapillaryImageImportForm (/admin/content/mapillary/images/import), in mapillary_field.
    • Both take a Mapillary ID, call MapillaryImageImporter and redirect to the imported entity.
    • The sequence form imports the metadata only, then queues the images through MapillarySequenceCascadeQueuer, like the Sequence ID widget.
    • They require administer mapillary_sequence and administer mapillary_image.
  • Local actions: "Import sequence" and "Import image" on the Sequences and Images listings. "Import detections" on the Detections and Map Features listings, linking the existing mapillary_detection.import form.
  • Fix: MapillaryDetectionImportForm redirected to mapillary_detection.content.detections, a route that no longer exists, so every successful import ended in a RouteNotFoundException. It now redirects to view.mapillary_detections.page_1.
  • README, CHANGELOG and AGENTS.md are updated.

No new permissions, no schema or config changes, no update hook. A cache rebuild is needed for the new tabs, actions and routes.

Tests

  • ContentLocalTasksTest (Functional):
    • the Mapillary tab on /admin/content;
    • every secondary tab on every listing;
    • each import action and the form it opens;
    • tabs and actions hidden without access, and a 403 on the import form.
  • MapillaryImportFormsTest (Kernel): success and failure of both import forms, with the importer and the queuer mocked.
  • DetectionImportFormTest (Kernel): the redirect route of the Detection import form.

Locally, the full module suite passes: 304 tests. The remaining deprecations come from contrib dependencies. PHPCS (Drupal standard) and PHPStan at level 0 report no errors.

Out of scope

  • Manual add forms. The entity types stay import-only.
  • An Organization import, since there is no importer for it.
  • The entity list builder routes (entity.mapillary_*.collection).

Closes #3629073

Merge request reports

Loading
Loading