Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reversion: hardcoded history URL in template raises issue if in version view #123

Closed
dcale opened this issue Aug 11, 2014 · 2 comments
Closed
Milestone

Comments

@dcale
Copy link

dcale commented Aug 11, 2014

When working with reversion and I open up a older version, then try to click on the "History" button on the right I get

invalid literal for int() with base 10: '1/history/3'

since django expects the url to be '/history/' but it's '/history/37/history/' (37 is the id of the history entry I opened up)

The issue is that the history link is hardcorded in a relative way (which works if the history is accessed from the entity page but not from the "older version" page)

Long story short I assume that instead of using

<li><a href="history/" class="historylink">{% trans "History" %}</a></li>

it should be

<li><a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a></li>

The files that need this change are:

lib/python2.7/site-packages/django_admin_bootstrapped/bootstrap3/templates/admin/change_form.html:    <li><a href="history/" class="historylink">{% trans "History" %}</a></li>
lib/python2.7/site-packages/django_admin_bootstrapped/bootstrap3/templates/admin/cms/page/change_form.html: <a href="history/" class="btn btn-inverse historylink">{% trans "History" %}</a>
lib/python2.7/site-packages/django_admin_bootstrapped/bootstrap3/templates/admin/filer/folder/change_form.html:      <li><a href="history/" class="historylink">{% trans "History" %}</a></li>
lib/python2.7/site-packages/django_admin_bootstrapped/bootstrap3/templates/admin/filer/image/change_form.html:    <li><a href="history/" class="btn historylink">{% trans "History" %}</a></li>
lib/python2.7/site-packages/django_admin_bootstrapped/templates/admin/change_form.html:    <a href="history/" class="btn btn-inverse historylink">{% trans "History" %}</a>
lib/python2.7/site-packages/django_admin_bootstrapped/templates/admin/cms/page/change_form.html:    <a href="history/" class="btn btn-inverse historylink">{% trans "History" %}</a>
lib/python2.7/site-packages/django_admin_bootstrapped/templates/admin/filer/folder/change_form.html:      <li><a href="history/" class="historylink">{% trans "History" %}</a></li>
lib/python2.7/site-packages/django_admin_bootstrapped/templates/admin/filer/image/change_form.html:    <li><a href="history/" class="btn historylink">{% trans "History" %}</a></li>

I hope this report helps.

@xrmx
Copy link
Contributor

xrmx commented Aug 11, 2014

Thanks for reporting

@xrmx xrmx added this to the 1.8.0 milestone Aug 12, 2014
xrmx added a commit that referenced this issue Aug 22, 2014
Forward porting templates changes from here:
django/django@c86a9b6

Fix #121, #123
@xrmx
Copy link
Contributor

xrmx commented Aug 22, 2014

Fixed in 6003137

@xrmx xrmx closed this as completed Aug 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants