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.

Command icon 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

man-1982 created an issue. See original summary.

a.koch82’s picture

Assigned: Unassigned » a.koch82
a.koch82’s picture

Status: Active » Needs review
StatusFileSize
new3.74 KB

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

arparker’s picture

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.

erik.erskine’s picture

Status: Needs review » Postponed (maintainer needs more info)

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 functioning correctly?

Maybe I've misunderstood something - if so, please reopen this.

a.koch82’s picture

Status: Postponed (maintainer needs more info) » Needs work
StatusFileSize
new75.59 KB
new53.49 KB

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.

router issue
router issue

a.koch82’s picture

Status: Needs work » Needs review
StatusFileSize
new25.19 KB

@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

chnages

Thanks

a.koch82’s picture

Status: Needs review » Reviewed & tested by the community
erik.erskine’s picture

Status: Reviewed & tested by the community » Needs review
frank mcreslan’s picture

woks well for me.
thnks

  • 82cb5248 committed on 2.1.x
    Issue #3409913 Add 'configure' property to info.yml file
    
erik.erskine’s picture

Title: Missing routing.yml » Add configure link to module listing page
Status: Needs review » Fixed

Committed, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.