2

I've written a very simple custom block, however when I try to install it I get the following error:

Fatal error: Call to undefined method stdClass::isInternalBlockType() in {REMOVED}/concrete/core/controllers/single_pages/dashboard/blocks/types.php on line 22

I've written another one just fine and it installed flawlessly, but this one is being a pain! The problem seems to be with controller.php as when I remove that it works fine (just installs with no meta data which is no good!)

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
class QuicklinksBlockController extends BlockController {

    protected $btTable = "btQuicklinks";
    protected $btInterfaceWidth = "600";
    protected $btInterfaceHeight = "400";

    public function getBlockTypeName() {
        return t('Quick Links Section');
    }

    public function getBlockTypeDescription() {
        return t('A quick links section block.');
    }

}
?>

So if I remove everything except the class line it installs, just with no title etc.

Ashley
  • 1,459
  • 2
  • 12
  • 25

2 Answers2

3

I also pulled this error. In my case it was caused by failing to follow the capitalization rules. the name of the block in the blocks directory has "words" separated by underscores, but these need to be caps in the name of the table. In other words, if your block in the blocks directory looks like this:

root/blocks/my_block

your block table table name must be:

btMyBlock

2

Fixed! I had forgotten to change the db.xml file to a new table name, thus the error.

Ashley
  • 1,459
  • 2
  • 12
  • 25