Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
You currently cannot create paths like blog/% as placeholders aren't replaced with slugs.
Proposed resolution
Replace them, but don't care yet about actual arguments.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#22 | 2352959-page-manager-arguments-22.patch | 3.14 KB | Berdir |
#15 | 2352959-page-manager-arguments-15.patch | 4.27 KB | dasjo |
#14 | arguments-2352959-type.interdiff.txt | 1.21 KB | Arla |
#11 | 2352959-page-manager-arguments-11.patch | 3.97 KB | tim.plunkett |
Comments
Comment #1
dawehnerHere is a first patch.
Comment #3
BerdirAre we going to support typed arguments with upcasting, or will we do that manually, later on? Like configuring somewhere that arg_1 is a taxonomy_term
Comment #4
tstoecklerReviving this. Have no opinion on #3.
Comment #6
tstoecklerHmm... patches are weird sometimes. Maybe this will work.
Comment #8
tstoecklerMeh.
Comment #9
tim.plunkettShould we, like Views does, support
%foo
in addition to%
?(Also, what a shame that code isn't located somewhere more useful)
If you end up rerolling, can you switch to [] syntax? Not a big deal.
Sorry for sitting on this one so long.
Comment #10
tim.plunkett#2329317: Trying to use node/%node as a path should fail seems to think we should explicitly prevent this.
I agree we should either support it, or prevent it.
Other thoughts?
Comment #11
tim.plunkettRerolled with short array syntax.
Comment #12
dasjotook me a while to find this one while searching for "dynamic context" support :)
just tested and works but wonder if the issue title makes sense?
Comment #13
rlmumfordThis seems to work well. I think we can leave questions about support '%foo' up to a future arguments issue when we sort out the upcasting.
Comment #14
ArlaMe and @Berdir used this patch on a project, but we also needed to be able to specify the types of the arguments, so we went ahead with the attached fix. It supports any of the patterns
%
,%arg
and%arg.type
. I'm just posting it here to try to get this ball moving again. I don't want to postpone this particular issue any further, so I'm leaving it RTBC and the patch in #11 should be regarded as current.Comment #15
dasjoPosting a patch that combines #11 + #14
Comment #18
saltednutI think maybe #15 should be another issue. I've re-queued the bot and would like to move forward with getting this in if it passes.
Comment #20
saltednutLooks like just
PageManagerRoutesTest
is failing so we should look into fixing that and moving forward with a followup to get the argument patterns from 14/15Comment #22
BerdirQuite a lot changed, here's a reroll.
Tests will probably fail, I'll address that asap.
I also removed the incorrect argument behavior and removed the empty default value for it.
Comment #24
BerdirThis has been implemented in #2631802: Allow explicitly configuring the type of context from parameters now, closing this as a duplicate.
In case someone was using the patch above, especially the part that allowed to specify types, you can use the following to update existing pages. It also supports to convert any path with % or %something to {something}, as % will likely not be supported anymore soon.
Comment #25
BerdirThat update function has a bug and breaks pages that override an existing path and use %. This is hacky but seems to work for me: