Unable to find Block controller 'is_a()' fails in 'add_block_popup'

Permalink
Hi

I get the following error when attempting to add a new block which successfully installed. "Unable to load the controller for this block type. Perhaps it has been moved or removed".

After looking at the core code it is this line which is failing:

if (!is_a($cnt, 'BlockController'))


Which suggests my controller is not a 'BlockController', using 'get_class()' on $cnt I can tell you that it is of type 'Controller' and not 'BlockController'.

This is the controller.php file:

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
class Binaryfold4ClientCostcalcDeckBlockController extends BlockController {
   var $pobj;
   protected $btDescription = "Cost Calculator for client.";
   protected $btName = "Cost Calculator for client";
   protected $btTable = 'btBinaryfold4ClientCostcalcDeck';
   protected $btInterfaceWidth = "350";
   protected $btInterfaceHeight = "300";
}
?>


Which appears to be pretty harmless and resides in this directory 'binaryfold4_client_costcalc_deck'.

Why is this failing?

Thanks,
Jake

BinaryFold4
 
BinaryFold4 replied on at Permalink Best Answer Reply
BinaryFold4
FIXED.

It might be worth mentioning in the documentation here:
http://www.concrete5.org/documentation/developers/system/packages/...

that the handle MUST be less than or equal to 32 characters in length.

Anything more and it will not fit in the BlockTypes table and it will fail miserably an attempt is made to actually use it. The 'installation' process doesn't flag this and merrily truncates the handle.

32 chars might seem excessive but when your required to have a unique handle for the marketplace then this will happen more and more often.

Jake