[ZCM] [ZC] 1845/ 5 Comment "ACTUAL_URL is not actual URL ;)"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Mon Jul 18 12:02:13 EDT 2005
Issue #1845 Update (Comment) "ACTUAL_URL is not actual URL ;)"
Status Pending, Zope/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/1845
==============================================================
= Comment - Entry #5 by limi on Jul 18, 2005 12:02 pm
1) If you look at the original use case and reason for introducing ACTUAL_URL, it was to use with anchors, which is why it needs the query string
2) The ACTUAL_URL code has existed for two point releases (introduced in 2.7.4 or 2.7.5), and I can't see how people can rely on it *not* having the query string part. People expect it to, as several bug reports in the Plone Collector has shown - which is why I'm here. ;)
Anyway, a notice in the changelog that it includes the query string should be enough. I doubt anyone has gotten around to including this call in their code yet - and if they have, they probably expect it to solve the anchor use case, which it won't - yet.
Thanks for the code snippet, will test.
________________________________________
= Edit - Entry #4 by yuppie on Jul 18, 2005 11:13 am
Changes: submitter email, edited transcript, new comment
fixed my last comment: should be ACTUAL_URL, not VIRTUAL_URL
________________________________________
= Comment - Entry #3 by yuppie on Jul 18, 2005 10:48 am
Before we add yet another variable, could you please test if this code has the desired behavior:
<a tal:define="actual_query python:request['QUERY_STRING'] and '?'+request['QUERY_STRING'] or ''"
tal:attributes="href string:${request/ACTUAL_URL}${actual_query}#someContent"
> Skip to content</a>
'URL' variables in REQUEST never include the query string, so I'm not sure if it is a good idea to change ACTUAL_URL. Changing its behavior might also break existing code.
________________________________________
= Comment - Entry #2 by ajung on Jul 18, 2005 1:37 am
Patches are welcome :-)
________________________________________
= Request - Entry #1 by limi on Jul 17, 2005 11:45 pm
This is a follow-up to http://www.zope.org/Collectors/Zope/1568
The new ACTUAL_URL variable is 95% there, but doesn't include the query string of the URL, which it has to do to solve the use case for why ACTUAL_URL was invented in the first place: HTML anchors.
Please do not invent yet another variable for this, but add the query string to ACTUAL_URL. The other variations needed can be constructed from the existing elements, this is a convenience method for developers who need to render the URL currently shown in the URL bar.
(And if you *do* invent another variable, please make ACTUAL_URL include the query string and find another name for the one without the query string. ;)
==============================================================
More information about the Zope-Collector-Monitor
mailing list