Fix MYSQL errors on  assign activity multiple, fixes #6584
Merge branch 'dev' into test