Call to a member function image() on a non-object in

Permalink
Hi
Trying to convert a block 5.6 to 5.7 and getting "Call to a member function image() on a non-object in .......... edit.php"
on this line
<?php  echo $al->image('field_3_image_fID', 'field_3_image_fID', 'Choose Image', $field_3_image); ?>

Can anyone advise please

Responsive
 
Responsive replied on at Permalink Reply
Responsive
in the block controller i have
public function edit() {      
      $this->set('field_2_wysiwyg_content', $this->translateFromEditMode($this->field_2_wysiwyg_content));   
      $this->set('field_3_image', (empty($this->field_3_image_fID) ? null : File::getByID($this->field_3_image_fID)));   
      $this->set('field_4_wysiwyg_content', $this->translateFromEditMode($this->field_4_wysiwyg_content));
   }
hutman replied on at Permalink Best Answer Reply
hutman
This error is saying that $al is not an object, nothing to do with what you are passing into the function.

You need this line somewhere on the page:

$al = Loader::helper('concrete/asset_library');