<?php foreach ($issue->getChildIssues() as $child_issue): ?>
	<?php if ($child_issue->hasAccess()): ?>
		<?php include_template('main/relatedissue', array('issue' => $child_issue)); ?>
	<?php endif; ?>
<?php endforeach; ?>
<?php foreach ($issue->getChildIssues() as $child_issue): ?>
	<?php if ($child_issue->hasAccess()): ?>
		<?php include_template('main/relatedissue', array('issue' => $child_issue, 'related_issue' => $issue)); ?>
	<?php endif; ?>
<?php endforeach; ?>
Fix undefined related_issue var when assigning child task to issue
Fix undefined related_issue var when assigning child task to issue
