Comments

arosboro created an issue. See original summary.

arosboro’s picture

Title: Special characters stripped out of metatag for image attribute filenames causing 404s » Panels token replacement doesn't handle url_encoded values well
StatusFileSize
new1.18 KB

Problem:

"/sites/default/files/filename-(1).jpeg" becomes "/sites/default/files/filename-%281%29.jpeg" due to sanitization. Panels uses % as an indication of a contextual keyword.

The attached patch minimizes this by including the first part of the keyword in the search pattern before doing a context keyword substitution.

arosboro’s picture

Status: Active » Needs review
arosboro’s picture

The previous patch had issues. Please review attached patch #4.

damienmckenna’s picture

Issue tags: +Needs tests

OH! Hah! Yeah, I bet that was a tricky one to track down :)

Lets see about adding a test to confirm the behavior.

arosboro’s picture

I've attached the patch with metatag_panels/tests included. The pages_default include has been updated with user context, and the abstract metatag is used with the string "http://www.example.com/user/%user:uid/full-bio-%281%29.pdf". Hoping to receive "http://www.example.com/user/1/full-bio-(1).pdf" after processing the context keyword replacements and decoding the url encoded value.

Status: Needs review » Needs work
arosboro’s picture

Forgot to include the test in the manifest

arosboro’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
arosboro’s picture

Status: Needs work » Needs review
StatusFileSize
new5.86 KB

I ran this one locally and cleaned up the errors with the test. metatag_hreflang passes as well for me.

Status: Needs review » Needs work
damienmckenna’s picture

Not sure why hreflang is failing..

So I think the test could be merged into the main test file, ultimately it's just one test method. Thanks.

arosboro’s picture

Status: Needs work » Needs review
StatusFileSize
new7.18 KB

Metatag Href with Entity Translation was failing because upstream or other code changes have lead to the default form language being set to 'en' and the index of the locale fields being changed to 'default' instead of 'value'.

arosboro’s picture

Hi Damien, I found the issue with metatag href... the form structure has changed recently. I'll look at adding these back into metatag_panels.test now.

arosboro’s picture

Good looks like everything's passing. Here's your revised patch with a single method in in the metatag_panels/tests/metatag_panels.test path.

damienmckenna’s picture

Lets deal with the Entity Translation changes in #2857982: Fixed tests in 7.x-1.x branch, so this can focus on the bugs in the Panels handling.

arosboro’s picture

Attached patch includes metatag_panels related test methods and fix for this issue.

Status: Needs review » Needs work
damienmckenna’s picture

Status: Needs work » Needs review

Now that #2857982 is fixed (thanks for that, btw) lets rerun the tests.

arosboro’s picture

Damien, Thanks for being on top of this over your weekend :)

arosboro’s picture

This has passed tests, just wondering if it can be included in a release anytime soon or if we are waiting for more RBTC feedback

damienmckenna’s picture

Status: Needs review » Fixed
Parent issue: » #2853846: Plan for Metatag 7.x-1.22 release

Committed. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.