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

Incorrect link in Organization snippet on dataset page #1882

Merged
merged 1 commit into from
Sep 4, 2014

Conversation

amercader
Copy link
Member

screenshot from 2014-08-13 12 16 09

Looks like if you define a variable inside a with statement on Jinja2 this variable is not available inside a block:

{% with truncate=truncate or 0, url=h.url_for(controller='organization', action='read', id=organization.name) %}
<!-- url defined here -->
  {% block info %}
  <div class="module module-narrow module-shallow context-info">
    {% if has_context_title %}
      <h2 class="module-heading"><i class="icon-building"></i> {{ _('Organization') }}</h2>
    {% endif %}
    <section class="module-content">
      {% block inner %}
      {% block image %}
        <div class="image">
          <a href="{{ url }}">      <!-- url not defined here -->
...

This means an empty href, which effectively links to the same dataset page.

Replaced use of `with` in the snippet.
@nigelbabu
Copy link
Contributor

This looks good to me. @amercader Can you add a quick test, please?

nigelbabu added a commit that referenced this pull request Sep 4, 2014
[#1882] Incorrect link in Organization snippet on dataset page
@nigelbabu nigelbabu merged commit 18ec600 into master Sep 4, 2014
amercader added a commit that referenced this pull request Sep 10, 2014
Replaced use of `with` in the snippet.

Conflicts:
	ckan/templates/snippets/organization.html
amercader added a commit that referenced this pull request Sep 10, 2014
Replaced use of `with` in the snippet.

Conflicts:
	ckan/templates/snippets/organization.html
amercader added a commit that referenced this pull request Sep 10, 2014
Replaced use of `with` in the snippet.

Conflicts:
	ckan/templates/snippets/organization.html
@smotornyuk smotornyuk deleted the 1882-incorrect-org-link branch December 19, 2018 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants