adding flag for publication from config
Merge pull request #3976 from vmancine/master

new flag publication
remove obsolete import
add protection against emtpy result objects