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.
Reading the code for render_as_field there is a sentence "// These can only be set internally at this time." I'm not sure why this is so maybe this quick patch is too quick?
Anyway I use parse_url to get/set the options fragment and/or query while removing them from the $path
Comment | File | Size | Author |
---|---|---|---|
#17 | views_399534.patch | 3.42 KB | drewish |
#13 | views_399534.patch | 3.42 KB | drewish |
#10 | views_399534.patch | 5.79 KB | drewish |
views_fragment_query.patch | 804 bytes | clemens.tolboom | |
Comments
Comment #1
clemens.tolboomThis patch makes it possible to jump strait to node/12#comments, node/12#video which is our dire need :)
Comment #2
deshilachado CreditAttribution: deshilachado commentedI was looking at the same comment and was wondering whether it is a security issue, but I know to little PHP & Drupal for deciding that.
There are several issues in Views issue queue about the ? or # being encoded, so this seems to be of interest to some more persons. Maybe the patch is only that straight forward for the # and not for the ? ??
Link to another issue realted to fragment being encoded: #371496: Output this field as a link not working?
Comment #3
clemens.tolboomComment #4
clemens.tolboomComment #5
deshilachado CreditAttribution: deshilachado commentedApplied the patch and it worked for me: As a field I chose Node:Nid, output as a link, rewrite the link as
comment/reply/[nid]#comment-form
and the link that is being displayed works. Great!I also tried Node:Link + rewrite output but then the there was some escpaed HTML (
<a href...>
) in the link.Comment #6
dagomar CreditAttribution: dagomar commentedI also was in need of this. For me the patch works. Hopefully this can be committed!
Comment #7
clemens.tolboom@ #5 I not quite follow your escaped HTML ... it that a bug?
Comment #8
deshilachado CreditAttribution: deshilachado commentedI'm not sure, but I think this is not a bug and doesn't result from your patch, but is a small weirdness in Views as described in comments #9 and #10 in issue #378710: "Output this field as a link" is unnecessarily escaped
Comment #9
clemens.tolboomBased on #5 and after feedback #8 about #6 I guess this patch is reviewed and tested :)
Comment #10
drewish CreditAttribution: drewish commentedtalked with merlin a bit on irc about this patch and he felt it needed a little more work. i'm adding a class and doing some coding standards clean up on it.
Comment #11
deshilachado CreditAttribution: deshilachado commenteddrewish, thanks for the work. I fail to apply the patch though, a simple
patch -p0 < views_399534.patch
doesn't do it for me but instead gives backI put the patch in all folders that make sense to me and tried patching from each location respectively.
Comment #12
merlinofchaos CreditAttribution: merlinofchaos commentedYup, I'm having trouble with that patch myself.
Comment #13
drewish CreditAttribution: drewish commentedokay how about this?
Comment #14
drewish CreditAttribution: drewish commentedfixing the status, i think this is less a bug fix than a feature.
Comment #15
deshilachado CreditAttribution: deshilachado commentedWorks for me:
Applied the patch and tried the following (as above): Create e new View, as field choose Node:Nid, output as a link, rewrite the link as
comment/reply/[nid]#comment-form
and the link that is being displayed works.Thanks!
I did not test queries
Comment #16
dawehneri looked at the patch and saw this:
Why is link_class translatable?
Comment #17
drewish CreditAttribution: drewish commenteddereine, all the other text was translateable, and i could imagine a case where you'd want to change the class based on the language... i'm not too concerned either way, if earl wants it out i'll re-roll with out it.
the last patch had gone stale so here's a re-roll.
Comment #18
deshilachado CreditAttribution: deshilachado commentedAgain, I applied the fresh patch and did the same simple test as above (which is a scenario I might use indeed).
Worked as expected
Comment #19
stevekerouac CreditAttribution: stevekerouac commentedApplied the patch from #17 in a similar fashion to that described in #5. Confirm it is working as expected.
Comment #20
pescetti CreditAttribution: pescetti commentedFrom discussions in #470904: Ampersand [&] gets replaced by [&] in the created URLs, this seems to be the same root cause for "&" being rendered as "&"; subscribing.
Comment #21
robertdjung CreditAttribution: robertdjung commented@pescetti -- I thought so too, but I've patched and still have the issue. Guidance?
Comment #22
Heilong CreditAttribution: Heilong commentedJust applied the patch and working...
Comment #23
pescetti CreditAttribution: pescetti commented@robertdjung: the patch in comment #17 does not work for me either (meaning: it does not solve the problem with ampersands in link URIs).
If the problem in #470904: Ampersand [&] gets replaced by [&] in the created URLs is really a duplicate of this one, then the patch should be reworked in order to fix the ampersand problem too.
Comment #24
merlinofchaos CreditAttribution: merlinofchaos commentedLooks like we're in good shape on this one now. Committed!
Comment #25
robertdjung CreditAttribution: robertdjung commented@pescetti, it's not a duplicate, it's related to feedapi instead.
For now, I've hacked the views module (SHAME!) in this manner: http://drupal.org/node/393470
See also: http://drupal.org/node/352004
Comment #26
pescetti CreditAttribution: pescetti commented@robertdjung: Thanks, but then my problem is different, since I'm not using feedapi. I'll investigate again and reopen #470904: Ampersand [&] gets replaced by [&] in the created URLs if needed.