Issue #2869621 Fixes SA-CONTRIB-2017-39
#1838940: pre_publish function not being called
Stable release
Accepted the following patches by Bevan:
Dev branch
Fixing permission problem
Initial workingn release