# Is the blockhandle protected in 9.0.2?

**URL:** <https://forums.concretecms.org/t/is-the-blockhandle-protected-in-9-0-2/2288>\
**Category:** Developing with Concrete\
**Created:** [January 28, 2022, 10:03am UTC](https://forums.concretecms.org/t/is-the-blockhandle-protected-in-9-0-2/2288 "2022-01-28T10:03:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronwiersma](https://forums.concretecms.org/user_avatar/forums.concretecms.org/ronwiersma/32/3495_2.png) [@ronwiersma](https://forums.concretecms.org/u/ronwiersma)\
**Post date:** [January 28, 2022, 10:03am UTC](https://forums.concretecms.org/t/is-the-blockhandle-protected-in-9-0-2/2288/1 "2022-01-28T10:03:39Z")

</div>

This code does not work anymore since updating to 9.0.2. The error is Cannot access protected property Concrete\Core\Block\Block::$btHandle. How to get the block type?

$c = \Page::getCurrentPage();  
$blocks = $c-\>getBlocks(); //Retrieving all Blocks Objects on a Page.

foreach ($blocks as $b) {

if($b-\>btHandle === ‘film\_blok\_homepage’){  
// code  
}

}

?\>

---

<div class="post-metadata">

**Author:** ![JohntheFish](https://forums.concretecms.org/user_avatar/forums.concretecms.org/johnthefish/32/3767_2.png) [@JohntheFish](https://forums.concretecms.org/u/JohntheFish)\
**Post date:** [January 28, 2022, 10:06am UTC](https://forums.concretecms.org/t/is-the-blockhandle-protected-in-9-0-2/2288/2 "2022-01-28T10:06:06Z")

</div>

$b-\>getBlockTypeHandle();

---

<div class="post-metadata">

**Author:** ![ronwiersma](https://forums.concretecms.org/user_avatar/forums.concretecms.org/ronwiersma/32/3495_2.png) [@ronwiersma](https://forums.concretecms.org/u/ronwiersma)\
**Post date:** [January 28, 2022, 10:08am UTC](https://forums.concretecms.org/t/is-the-blockhandle-protected-in-9-0-2/2288/3 "2022-01-28T10:08:05Z")

</div>

Great that works, thanks!

---

<div class="post-metadata">

**Author:** ![simonchilton](https://forums.concretecms.org/user_avatar/forums.concretecms.org/simonchilton/32/4205_2.png) [@simonchilton](https://forums.concretecms.org/u/simonchilton)\
**Post date:** [May 2, 2024, 3:06pm UTC](https://forums.concretecms.org/t/is-the-blockhandle-protected-in-9-0-2/2288/4 "2024-05-02T15:06:03Z")

</div>

> [@JohntheFish](#):
>
> getBlockTypeHandle();

You’re always getting me out of trouble, John! Thanks 🙂
