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.
I use "Image Link Formatter" to link to a field. Upgrading to new version 7.x-1.3 removes Query string (everything after the ? in the URL)
Removing 7.x-1.3 and installing 7.x-1.2 fixed the problem.
Thanks for your hard work.
Comment | File | Size | Author |
---|---|---|---|
#5 | link_7.x-1.3-removes-query-string_2361283_5.patch | 884 bytes | karenann |
Comments
Comment #1
gmclelland CreditAttribution: gmclelland commentedI think #1955976: Allow relative paths with validation introduced a regression. I'm having similar problems with #2367069: Link 1.3 removes the query string from field tokens.
The commit at http://cgit.drupalcode.org/link/commit/?id=7965384720ca20dab256b227bbae7... is the last known good commit for me.
The commit at http://cgit.drupalcode.org/link/commit/?id=85ab462a946b60aa90011b5c4f81e... is the commit that causes problems for me.
Can you see if it this the same for you?
Comment #2
jcfiala CreditAttribution: jcfiala commentedAlright, that's pretty important. I'll try to put some time in this weekend to reproduce the problem and see why one of the tests I have didn't catch this.
Comment #3
gmclelland CreditAttribution: gmclelland commentedGreat, thank you @jcfiala!
Comment #4
karenann CreditAttribution: karenann commentedI confirmed this before I actually found this thread.
If I undo the following code found in 85ab462a946b60aa90011b5c4f81ead6bd31314d, it restores expected behavior.
The way I experience the problemis this:
I'm using the link fields to hold a link with a querystring. I am then using views to with an field using that link field. The field is set to Title only and is rewritten to include the token of the [myfield-url] == Raw url.
Comment #5
karenann CreditAttribution: karenann commentedI haven't tested whether or not this has impacts elsewhere, but it's a start, I guess.
Comment #6
jcfiala CreditAttribution: jcfiala commentedIf we set the ticket to "Needs review", then the automatic engine will run tests against it.
That being said, part of fixing this ticket is setting it up so that the automated tests will catch this problem in the future.
Comment #8
jcfiala CreditAttribution: jcfiala commentedHmm.. I'm not familiar with Image Link Formatter - does it use field tokens? I do have a test that makes sure a querystring is output normally, and that test is passing.
Comment #9
jcfiala CreditAttribution: jcfiala commentedOh, I see... huh. That's interesting. I didn't realize anyone was depending on that information.
Comment #10
gmclelland CreditAttribution: gmclelland commented@jcfiala - For what is worth, I'm not using the Image Link Formatter module. I'm just using the link module with the token module.
Comment #11
jcfiala CreditAttribution: jcfiala commented@gmclelland - Yes, that's what I'm working on making tests around right now. I thought I had token tests, but apparently I was testing if a token worked in the field title, not that a token referencing the field would work.
Comment #12
jcfiala CreditAttribution: jcfiala commented@gmclelland - Which version of the entity (entity api) module are you using? I'm using 7.x-1.5, and I'm not having a problem with the [node:field-name:url] token so far - I generated a url which was something like http://example.com/bl83fhe#lower?property=value2, and the token was replaced with http://example.com/bl83fhe#lower?property=value2.
Comment #13
gmclelland CreditAttribution: gmclelland commentedStrange.. I'm using the 7.x-1.5 as well.
Comment #14
jcfiala CreditAttribution: jcfiala commentedWell, I'm not sure what to say here. As for Image Link Formatter, I'm not the person maintaining that module. I'm willing to work with the maintainer a bit, but this is mostly code changing internal to the link field, and there's not guarantee that things won't shift, although it's generally true that running l() or url() as listed in theme_link_formatter_link_default or theme_link_formatter_link_plain will result in a legal url.
I'm not sure we'll walk this change back or not at the moment - I'm not able to reproduce #2367069: Link 1.3 removes the query string from field tokens at the moment.
Comment #15
jcfiala CreditAttribution: jcfiala commentedI may have fixed this in #2367069: Link 1.3 removes the query string from field tokens. Tomorrow, could folks try downloading the 7.x-1.x-dev version of the module and test the change and see if it fixes your problems as well? I suspect it will.
For the moment, I'm closing this as a duplicate - if we still have problems here we can re-open it.
Thanks for the help!
Comment #16
esod CreditAttribution: esod commentedWe're migrating data into our system. The imported data for the link field may or may not have query string parameters. Using version 7.x-1.3 the query string parameters are being stripped out. We switched to 7.x-1.x-dev and the query string parameters are not being stripped out.
Comment #17
shaune CreditAttribution: shaune commentedI use field tokens/replacement patterns in Views "Rewrite Results" and 7.x-1.3 stripped the query string. I can also confirm that the 7.x-1.x-dev version does not strip the query string parameters. Thanks for the fix!
Comment #18
achton