Block Install fails even after displaying success message

Permalink
Hi

I have created a basic Block based on the Basic Test block available on the C5 web site.

When I try and install this from the Add Functionality tab the success message "Block Type Installed." appears but the Block is still available for adding and doesn't appear in the list of custom add-ons.

Permissions are the same as the Basic Test Block which successfully installed.

Can any one help?

Thanks,
Jake

BinaryFold4
 
jordanlev replied on at Permalink Reply
jordanlev
Sounds like there might be an error in the code or perhaps a misnamed folder or class. Can you zip up the block you're working on and post it here so we can see?
BinaryFold4 replied on at Permalink Reply 1 Attachment
BinaryFold4
Hi jordanlev

It should be attached to this reply.

Thanks
jordanlev replied on at Permalink Best Answer Reply
jordanlev
I think there's a bug in the concrete5 system itself (well, more of an undocumented requirement) that every block must have a db.xml file and that db.xml file must declare at least 2 fields -- a "bID" field and one other field of any kind (even if that other field isn't used).

So you want to take the db.xml file from the sample block you were using and drop that into your block. Change the table name in it though (to something like "btShareLocation", and also remember to set the table name in your block controller:
protected $btTable = 'btShareLocation';

BTW, you are calling a function "$controller->getDefaultBlockLocation()" in your view and edit files, but you didn't actually create that function in your controller.
Add this to your controller:
public function getDefaultLocation() {
   return 'something';
}