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

Warn when the output filename expression returns a NULL value or is wrong #21442

Open
qgib opened this issue Sep 21, 2015 · 5 comments
Open

Warn when the output filename expression returns a NULL value or is wrong #21442

qgib opened this issue Sep 21, 2015 · 5 comments
Labels
Feature Request Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@qgib
Copy link
Contributor

qgib commented Sep 21, 2015

Author Name: Harrissou Santanna (@DelazJ)
Original Redmine Issue: 13390

Redmine category:map_composer/printing


Create an atlas and in output filename expression, put a wrong formula, something like 'output'||@atlasfeaturenum
Then export the atlas. all the process will go till the end even though no file will be generated.

I think that the user should be warned about the error:

  • when he clicks out of the expression textbox
  • or when he clicks on the export button
@qgib
Copy link
Contributor Author

qgib commented Oct 11, 2015

Author Name: Anita Graser (@anitagraser)


  • fixed_version_id was changed from Future Release - High Priority to Future Release - Nice to have
  • priority_id was changed from High to Normal
  • subject was changed from Print Composer : Warn when the output filename expression return a NULL value or is wrong to Warn when the output filename expression returns a NULL value or is wrong
  • tracker_id was changed from 1 to 2

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0

@qgib qgib added Feature Request Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels May 25, 2019
@qgib qgib added this to the Future Release - Nice to have milestone May 25, 2019
@troopa81
Copy link
Contributor

troopa81 commented Jul 6, 2020

I faced a likely issue. If the field targeted in expression contains special character (/ \ or space character) the filename could be invalid, and you get a big error message. I'm wondering if we should not try to slugify the generated name to ensure filename validity.

If somebody stumble upon the same problem, I fixed it with replace_regexp

regexp_replace("output" || name_with_special_character, '[^\\w]', '_')

@DelazJ
Copy link
Contributor

DelazJ commented Jul 6, 2020

I'm wondering if we should not try to slugify the generated name to ensure filename validity.

@troopa81 you probably fall into #37225 case

@troopa81
Copy link
Contributor

troopa81 commented Jul 6, 2020

@DelazJ Yes indeed, makes sense! Thanks for the link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

No branches or pull requests

3 participants