area->getAreaCustomTemplates() returning empty array from Block Form

Permalink
Hi all,

For a website I'm developing in Concrete5.7 I created a custom Block which uses multiple templates. I wanted to change the form for the block a bit depending on which template is used. To set which templates should be used in what areas I'm using:
Area::setCustomTemplate()


Page template:
$hero = new Area('hero');
$hero->setCustomTemplate('multi_media', 'templates/hero');
$hero->setBlockLimit(1);
$hero->display($c);


When I do
var_dump($hero->getAreaCustomTemplates());
in the Page template (after defining the Area) it dumps
array(1) { ["multi_media"]=> string(14) "templates/hero" }
as expected and when I add the multi_media block to that area, it will indeed pick the 'hero' template for it. Also when I do
var_dump($this->area->getAreaCustomTemplates());
from the Block's 'view.php' (or '/templates/hero/view.php') it will dump the correct Array.

But when I try to do the same from the Block's Form it dumps an empty Array:
array(0) { }
. When I try to get the AreaHandle from there, it works fine:
var_dump($this->area->arHandle)
dumps
string(4) "hero"
as expected. When I dump the entire Area object, the $arCustomTemplates property within is an empty array as well.

I'm pretty much stuck on this and core-crawling didn't solve anything for me unfortunately. Is this expected behavior and am I missing something, or is this a bug?

I'm running Concrete5.7.5.3