| Project: | OpenLayers |
| Version: | 7.x-2.x-dev |
| Component: | OL Styles |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| openlayers_style_path-must-not-use-language-prefixes-and-whitespaces.patch | 4.64 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 236 pass(es). | View details |
| openlayers_style_path-must-not-use-language-prefixes.patch | 1.15 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 236 pass(es). | View details |
Comments
#1
In my case the use of
url()breaks images when clean urls are off. Should switch tofile_create_url()or something.#2
Thanks to nod_ for the discussion via IRC.
I've created a patch that uses
file_create_url()now.#3
Sweet, works well. I'll let zzolo handle committing.
#4
For information, whitespace fix is now useless since all excessive whitespace was removed a little while after the patches were sent.
#5
Thank you :D
#6
Automatically closed -- issue fixed for 2 weeks with no activity.
#7
patch works!