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.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2024-09-05_17-49.png | 25.19 KB | a.koch82 |
| #6 | 2024-09-05_17-05-2.png | 53.49 KB | a.koch82 |
| #6 | 2024-09-05_17-04-1.png | 75.59 KB | a.koch82 |
| #3 | data_range-3409913-1.patch | 3.74 KB | a.koch82 |
Issue fork daterange_compact-3409913
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 #2
a.koch82 commentedComment #3
a.koch82 commentedThis 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
Comment #4
arparker commentedPatch #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.
Comment #5
erik.erskine commentedThe entity type definition includes a
route_providerproperty, 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_formatconfig entities too.I don't see why a
routing.ymlfile is needed.Are they not functioning correctly?
Maybe I've misunderstood something - if so, please reopen this.
Comment #6
a.koch82 commentedwe have daterange_compact.links.menu.yml:
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.
Comment #8
a.koch82 commented@erik.erskine
Sorry, I double-checked. You are right. There is no need extra router files.
I've made some changes in MR:
Thanks
Comment #9
a.koch82 commentedComment #10
erik.erskine commentedComment #11
frank mcreslan commentedwoks well for me.
thnks
Comment #13
erik.erskine commentedCommitted, thanks!