symphonycms icon indicating copy to clipboard operation
symphonycms copied to clipboard

Prepopulate misbehaving

Open designermonkey opened this issue 10 years ago • 5 comments

Given the URL https://domain.com/publish/section-name/new/?prepopulate[451]=regexp%3A%20jrp, the field in question is populated with regexp: jrp.

Expected value is jrp.

designermonkey avatar Jul 31 '15 13:07 designermonkey

I would ping @michael-e on this one...

But John, do you know where the %3A character comes from ?

nitriques avatar Jul 31 '15 20:07 nitriques

I don't believe we do any handling to strip the filtering prefixes from data before handing it to a field currently, so this is the expected behaviour at the moment from me. It's a good idea though, I can't see any reason why the field would need to know filtering information when prepopulating.

brendo avatar Aug 03 '15 03:08 brendo

I agree with @brendo. It's expected behaviour, but it could be improved.

michael-e avatar Aug 03 '15 09:08 michael-e

Adding my two pence here, as directed by @nitriques.

I'm trying to create contextual admin links from the front-end to the back-end UI for logged-in authors. So far so good with basic section links and filtering. However, pre-populating SBLs doesn't appear to accept the field handle and there seems no easy way to know the field's ID e.g.

/symphony/publish/test/new/?prepopulate[11]=222 works as expected

/symphony/publish/test/new/?prepopulate[selector]=222 does not populate SBL

Incidentally, /symphony/publish/test/new/?prepopulate[11]=item-handle does not populate SBL

If pre-populating by field handle string turns out to be a big headache, please could each field's ID be passed to the XML.

cylkee avatar Feb 02 '17 10:02 cylkee

Funny or not, mod_sec prevents me from using regexp: in the url. I think it would be wise to change this to something else.

@cylkee

If pre-populating by field handle string turns out to be a big headache

Yes it is. It could be enabled, but not a priority sadly. If you want to send a PR, I'll gladly help you test it.

please could each field's ID be passed to the XML.

That's doable too if you want to poke at it!

nitriques avatar Apr 07 '17 19:04 nitriques