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

Powered by Tripal block not displayed correctly on pages with existing path prefix #918

Closed
mdondrup opened this issue Apr 1, 2019 · 2 comments

Comments

@mdondrup
Copy link

commented Apr 1, 2019

BUG/ERROR report

This is just a minor issue affecting the Powered by Tripal block, but it might cause hard to debug race conditions on pages that contain ajax calls and include this block as a footer (in particular when using extension code that uses $_SESSION variables).

System information

  • Tripal Version: 7.x-2.x I just noticed that this only affects 2.x!
  • Drupal Version: not relevant
  • PostgreSQL Version: not relevant
  • PHP Version: 7.1

Issue description

The Tripal logo is not displayed correctly on pages that include an existing path prefix in their URLS (e.g. /search)

The following line should be changed to yield the absolute image path (/sites/all/modules/...), not the relative one:

'#markup' => '<a href="http://tripal.info"><img border="0" src="' . drupal_get_path('module', 'tripal') . '/theme/images/' . $image . '"></a>',

'#markup' => '<a href="http://tripal.info"><img border="0" src="/' . drupal_get_path('module', 'tripal') . '/theme/images/' . $image . '"></a>',

Steps to reproduce

The logo is not displayed, but instead a web server thread will be loading until request timeout because of the incorrect image request URL sent to site search: /search/sites/all/modules/tripal/tripal_core/theme/images/powered_by_tripal_small.png

Error messages and screenshots

Screenshots from before and after changing to absolute path, displaying the block from: /search/gene

image
image

@bradfordcondon

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

this seems straight forward to me, i'd welcome a PR to fix

mdondrup added a commit to mdondrup/tripal that referenced this issue Apr 2, 2019
Powered by Tripal block not displayed correctly on pages with existin…
…g path prefix tripal#918

Changed image path of the Tripal logo to absolute to allow it to be displayed correctly on all pages.
@mdondrup

This comment has been minimized.

Copy link
Author

commented Apr 2, 2019

Sorry, this is only in 2.x not 3.x. In 3, $base_path is used which does give the correct path.

@mdondrup mdondrup closed this Apr 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.