add scope for generateTreeList - resolves ticket 4028
Merge pull request #1585 from dereuromark/2.4-generatetreelist-scope

Bugfix: Add scope for generateTreeList

Fixes #4028