Problem While Building Audio Player Block
Permalink
While following the "Build an Audio Player Block for Concrete5" tutorial by Andrew Embler seen here (https://www.youtube.com/watch?v=JcpxxRsii0U... ), I run into the following error: An unexpected error occurred. Call to a member function getColumns() on null....
I get this error despite the fact that I follow the tutorial verbatim. The error occurs @ 30:11 in the video tutorial as I'm following Andrew when I click the Add button to add the audio player to the page.
I've looked over my code several times but have no idea where the problem is coming from. I'm guessing it has something to do with the way the block type is trying to interact with the database model...
Another problem is the how the error is rendered. The error is displayed in two popup modal windows containing a bunch of appended useless information.
Here is the code contained in my controller.php, form.php, and db.xml files respectively:
controller.php
form.php
db.xml
I get this error despite the fact that I follow the tutorial verbatim. The error occurs @ 30:11 in the video tutorial as I'm following Andrew when I click the Add button to add the audio player to the page.
I've looked over my code several times but have no idea where the problem is coming from. I'm guessing it has something to do with the way the block type is trying to interact with the database model...
Another problem is the how the error is rendered. The error is displayed in two popup modal windows containing a bunch of appended useless information.
Here is the code contained in my controller.php, form.php, and db.xml files respectively:
controller.php
<?php namespace Application\Block\Audio; use Concrete\Core\Block\BlockController; defined('C5_EXECUTE') or die(_("Access Denied")); class Controller extends BlockController { protected $btTable = "btAudio"; protected $btInterfaceWidth = "350"; protected $btInterfaceHeight = "290"; protected $btDefaultSet = 'multimedia'; public function getBlockTypeName() { return t('Audio Player'); } public function getBlockTypeDescription()
Viewing 15 lines of 19 lines. View entire code block.
form.php
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $al = Core::make('helper/concrete/asset_library'); ?> <div class="form-group"> <label class="control-label"><?=t('Audio File')?></label> <?=$al->audio('fID', 'fID', t('Audio File')); ?> </div> <div class="form-group"> <label class="control-label" for="name"><?=t('Name')?></label> <input type="text" class="form-control" name="name"> </div> <div class="form-group"> <label class="control-label" for="description"><?=t('Description')?></label> <input type="text" class="form-control" name="description">
Viewing 15 lines of 16 lines. View entire code block.
db.xml
<?xml version="1.0"?> <schema version="0.3"> <table name="btAudio"> <field name="bID" type="I"> <key /> <unsigned /> </field> <field name="fID" size="10" type="I"> <default value="0" /> <unsigned /> </field> <field name="name" type="X"> <default value="" /> </field> <field name="description" type="X">
Viewing 15 lines of 19 lines. View entire code block.
How large is the Audio file that you are trying to access? I have had this issue before where the server memory limit was running out and I would get an error just like that one that looked completely wrong and not helpful. If you try to use just a tiny tiny file do you get any different results?
The audio file is only 5.3MB.