Problem/Motivation

Markers with an externalGraphic defined don't show up if you've enabled language prefixes for urls.
Currently openlayers_style_path() uses url() to get the file-url, but unfortunately this function adds a language prefix if these prefixes are enabled.
This makes the returned url useless for our purpose.

The function openlayers_style_path() was introduced by #1127498: Variable styling syntax being urlencoded for externalGraphics links (Commit: b48585aca7dda5c480832942551aa7b5a02620d7), but the usage of url() was already introduced by #854552: Support Drupal paths for style graphics (Commit: 025bb538f9397eb96f805425fc047c67c7f77027)

Proposed resolution

Handover a fake $language object to avoid adding a prefix.
As mentioned by nod_ in #1 file_create_url() looks like the correct approach!

Remaining tasks

Review latest patch: #2

User interface changes

none.

API changes

none.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

das-peter’s picture

Issue summary: View changes

Updated issue summary.

nod_’s picture

In my case the use of url() breaks images when clean urls are off. Should switch to file_create_url() or something.

nod_’s picture

Issue summary: View changes

Updated issue summary.

das-peter’s picture

Title: openlayers_style_path() must not use language prefixes in returned url. » openlayers_style_path() must not use url() to create file paths.
FileSize
4.07 KB
618 bytes

Thanks to nod_ for the discussion via IRC.
I've created a patch that uses file_create_url() now.

das-peter’s picture

Issue summary: View changes

Updated issue summary.

nod_’s picture

Status: Needs review » Reviewed & tested by the community

Sweet, works well. I'll let zzolo handle committing.

nod_’s picture

For information, whitespace fix is now useless since all excessive whitespace was removed a little while after the patches were sent.

nod_’s picture

Status: Reviewed & tested by the community » Fixed

Thank you :D

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

valderama’s picture

patch works!

valderama’s picture

Issue summary: View changes

Updated issue summary.