I have a PDF file in which one of the field keys is "Date - mm/dd/yyyy". When I try to access the Edit field mapping page, which is at "admin/structure/fillpdf/147/edit/Date - mm/dd/yyyy", I get a "page not found" error. The URLs need to use an encoded version of the field key to avoid having incompatible characters.

Comments

wizonesolutions’s picture

Thanks for reporting. If you've got time to post a patch I can commit it.

liam morland’s picture

Title: Editng mappings fails when PDF field key contains a slash » Editing mappings fails when PDF field key contains a slash
Status: Active » Needs review

The attached patch fixes the problem by using an encoded version of the pdf_key in the URL. It makes the URLs a bit messy since they have to be run through rawurlencode() twice. It would be tidier and work to, for example, replace "/" with "!", but then you couldn't have an exclamation mark in a pdf_key.

liam morland’s picture

StatusFileSize
new1.06 KB
wizonesolutions’s picture

Status: Needs review » Needs work

Edit link for a field called Personal/FirstName doesn't work. Only single encoding seems to be needed. Troubleshooting patch.

wizonesolutions’s picture

Status: Needs work » Needs review
StatusFileSize
new1.05 KB

Let me know if this one still works for you. I'd commit it, but I assume you did not double-rawurlencode without a good reason. Let me know more about your use case, browser, anything that might be affecting things.

liam morland’s picture

Sometimes, %2f gets decoded and sometimes it doesn't. It depends on the setting of Apache's AllowEncodedSlashes Directive. Encoding it twice will always work.

wizonesolutions’s picture

Status: Needs review » Needs work

I think you didn't double-decode then, so it failed on my system. I got a page not found. Will take another look.

wizonesolutions’s picture

Status: Needs work » Needs review
StatusFileSize
new1.08 KB

Double decode works. Patch attached. Does this look good to you? If so, will commit.

liam morland’s picture

Ah, with my Apache setting, I didn't need to double decode because Apache was already doing that. I will test your latest patch Monday and get back to you.

liam morland’s picture

Status: Needs review » Reviewed & tested by the community

#8 works for me.

wizonesolutions’s picture

Status: Reviewed & tested by the community » Fixed

Pushed (06cd92a).

wizonesolutions’s picture

Status: Fixed » Patch (to be ported)

Oh yeah. D6.

liam morland’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
x-drup’s picture

Issue summary: View changes
Status: Patch (to be ported) » Fixed
x-drup’s picture

Status: Fixed » Patch (to be ported)
alexborsody’s picture

StatusFileSize
new623 bytes

Thanks, D6 patch attached.

alexborsody’s picture

Status: Patch (to be ported) » Closed (fixed)

Committed in acb41b5.

alexborsody’s picture

StatusFileSize
new1.23 KB

this is the correct patch

dmgenesys’s picture

In my case this patch killed the ability to edit mappings resulting in 404 for fields that did not contain slashes - removing the patch restored editing. Please take a look.

wizonesolutions’s picture

Please open a new issue so we can work on this against a known version. Test it on the latest 6.x or 7.x -dev version. This issue is already done with.

  • Commit 06cd92a on 7.x-1.x, 7.x-2.x, 7.x-2.x-tests1, 7.x-1.x-ubercartbackporttest authored by Liam Morland, committed by wizonesolutions:
    Issue #1830168: Allow slashes in PDF key.