Missing routing.yml

Created on 20 December 2023, 11 months ago
Updated 6 September 2024, 2 months ago

Problem/Motivation

Compact date/time range formatter module seems to be missing a routing.yml file.
This file is important for setting up routes for the module's entity type.
Right now, without this file, we can't reach the admin pages for managing the entity, even though there are menu links in daterange_compact.links.menu.yml.

Drupal version : 10.2.0
PHP version : 8.1.25
Admin theme : gin
PHP OS : Linux

The module has a custom entity type called daterange_compact_format. It has menu links for adding, editing, deleting, and listing these entities. But, because there's no routing.yml file, these links don't work and lead to "Page not found" errors.

Steps to reproduce

  • Install module.
  • Go to /admin/config/regional/daterange-compact-format

Proposed resolution

We should add a routing.yml file to define routes for the admin pages of the entity.
This will make sure the menu links work and users can manage daterange_compact_format entities properly.

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada man-1982

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @man-1982
  • Assigned to man-1982
  • Status changed to Needs review 11 months ago
  • πŸ‡¨πŸ‡¦Canada man-1982

    This patch aims to enhance the daterange_compact module by ensuring that its configuration pages are accessible and function correctly. It also adds a layer of automated testing for future development and maintenance.

    Please review the attached patch and provide any feedback or additional testing from the community.

    Added daterange_compact.routing.yml and Functional Test DateRangeCompactRoutingTest.php

  • Patch #3 worked for me; however, it is missing an "Add" button on the config page, so I had to edit an existing format for this to work. I was able to manually get to the add page, but could not save the new pattern.

  • Status changed to Postponed: needs info 3 months ago
  • πŸ‡ΈπŸ‡ͺSweden erik.erskine

    The entity type definition includes a route_provider property, which provides routes for add/edit/delete forms plus the collection. They are very similar to what's in this patch.

    There is no canonical route, but that's true of core's date_format config entities too.

    I don't see why a routing.yml file is needed.

    This patch aims to enhance the daterange_compact module by ensuring that its configuration pages are accessible and function correctly.

    Are they not? Maybe I've misunderstood - if so, please reopen this.

  • Status changed to Needs work 2 months ago
  • πŸ‡¨πŸ‡¦Canada man-1982

    we have daterange_compact.links.menu.yml:

    entity.daterange_compact_format.collection:
      title: 'Compact date and time range formats'
      route_name: entity.daterange_compact_format.collection
      description: 'Configure how date and time ranges are displayed in a compact form.'
      parent: system.admin_config_regional
      weight: 0
    

    it's mean that we expect in url /admin/config/regional/daterange-compact-format (=entity.daterange_compact_format.collection) entities list collection
    instead we have "Page not found"
    I attached a couple screenshot to be more clarified.


  • Merge request !5Core version 11 and functional tests β†’ (Open) created by man-1982
  • Status changed to Needs review 2 months ago
  • πŸ‡¨πŸ‡¦Canada man-1982

    @erik.erskine
    Sorry, I double-checked. You are right. There is no need extra router files.
    I've made some changes in MR:

    • Added configure route
    • Added some simple functional tests

    Thanks

  • Status changed to RTBC 2 months ago
Production build 0.71.5 2024