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

qlr and other downloads do not name file properly with spaces #360

Closed
gubuntu opened this issue Oct 19, 2017 · 7 comments
Closed

qlr and other downloads do not name file properly with spaces #360

gubuntu opened this issue Oct 19, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@gubuntu
Copy link

gubuntu commented Oct 19, 2017

If the layer or map name has spaces then the qlr filename generated stops at the first space and does not add .qlr

same for leaflet download (and probably others)

(from testing server)

depends on #438

child of #457

@gubuntu gubuntu added the ready label Oct 19, 2017
@gubuntu gubuntu changed the title qlr download does not name file properly with spaces qlr and other downloads do not name file properly with spaces Oct 20, 2017
@boney-bun
Copy link

could you give me an example from testing?

i may misunderstand this issue, but i couldn't find the case where the file naming failed with spaces.
or, this issue may be no longer valid.

@Gustry
Copy link
Collaborator

Gustry commented Oct 26, 2017

Even if you can't replicate, I think we need to remove spaces. It's not a good habit to have spaces in file name. Let's replace them with an underscore.

@NyakudyaA
Copy link
Collaborator

This is now working albeit with some inconsistency

@boney-bun have I see the same file has been altered differently. In some instances the space has been removed completely and in other instances the space has been replaced with a dash (-)

  • file with spaces ready for upload
    screenshot 2018-10-09 at 17 18 04

  • uploaded shape file
    screenshot 2018-10-09 at 17 18 31

  • Downloaded layers
    screenshot 2018-10-09 at 17 20 03

If this inconsistency does not bother anyone then we can close this one . But I am in favour of having a standard - be it remove the space completely or replace it with a dash not to have a mix of both within the same layer

@boney-bun
Copy link

boney-bun commented Oct 29, 2018

@gubuntu i think @NyakudyaA case is the expected behaviour from the vanila geonode.
spaces have consistently being replaced with underscores in the file names.
what misleaded us in your example above is the title part.
the geo-file in layer detail page shows a title, not a file name.

i've been looking at the codes, here are the logic for determining title when uploading files:

  • If a layer has a title, use the title as is.
  • if a layer has no title, use the file name as the title.
    the convention for the title in this case is:
    • the title allows only alphanumerics, underscores, and hyphens.
    • if the file name has spaces, replace with hyphens.

so, the geo-file refers to title, not file name.
i think the hyphen was added merely as cosmetic.

all in all, can we close this issue then?

@NyakudyaA
Copy link
Collaborator

@boney-bun I understand that's what vanilla Geonode does. Do you think the Geonode community chose to use hyphen because it looks nicer than underscore for the title?. I just thought we could standardize and use an underscore everywhere rather than mixing between the two whether it's being used in the title or the layer name

@boney-bun
Copy link

@NyakudyaA indeed.. it's a matter of personal preference.
i don't have problem either using underscores or hyphens for replacing spaces in the title.

@gubuntu which one do you prefer for title?

@gubuntu
Copy link
Author

gubuntu commented Oct 31, 2018

Let's leave upstream to put hyphens in titles.

As long as the OP is fixed (which it seems to be) we can close this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants