Fixing transactions to work with Phabricator changing projects to edges
fixed issue with maniphest where having no tasks would break maniphest with an exception

(cherry picked from commit d156f4c776563927b13d368ea5ad059315c2d6fb)

This issue affects PHP prior to 5.4