getTotalBlocksInArea($c) is not working on layouts. Is this a bug?

Permalink
When an area contains only a layout with blocks within it, it is not finding this with the getTotalBlocksInArea($c) function. Is there another function I should be using to determine if there are layouts which are populated? Here is my code snippet...

<?php $a = new Area('Main');
if ($a->getTotalBlocksInArea($c) > 0 || $c->isEditMode()) { ?>
    <div class="centered">
        <div class="extra-block">
            <?=$a->display($c);?>
        </div>
    </div>
<?php } ?>

 
Mnkras replied on at Permalink Reply
Mnkras
thats because there are no blocks in the area, just a layout that has blocks,

im not sure if its a bug, but we should have a way of getting the area names in an area
olacom replied on at Permalink Reply
olacom
i'Ve just got that problem twice and I just figured out that it was due to this. I think this should be look into :-)
jordanlev replied on at Permalink Best Answer Reply
jordanlev
In case anyone comes across this in the future, I've posted a fix here:
http://www.concrete5.org/community/forums/usage/layout-makes-blocks...