Enonic version: 7.8.3
OS: Linux
Hi,
I have a mapping to a filter, which seems to have broken in more recent versions of XP (7.8.x ?).
I have one content, that I want to split into many sub-pages. I use a filter
to change a url from /mypath/skjema/side1
to /mypath?pageKey=side1
<?xml version="1.0" encoding="UTF-8"?>
<site>
<mappings>
<mapping filter="/filters/form-subpage.js" order="40">
<pattern>.*/skjema/.*</pattern>
</mapping>
</mappings>
</site>
import { substringAfterLast, substringBefore } from "../lib/strings"
export function filter(req: XP.Request, next: XP.Controller): XP.Response {z
return next({
...req,
path: substringBefore(req.path, "/skjema/"),
params: {
...(req.params ?? {}),
pageKey: substringAfterLast(req.path, "/skjema/"),
},
})
}
This has stopped working with the following message, even if I change the path
i pass into next()
.
(/filters/form-subpage.js) com.enonic.xp.web.WebException: Page [/mysite/mypath/skjema/about] not found
Can it be that next()
doesn’t take the submitted path
into account anymore?
– Tom