Error when trying to edit block

Permalink
I wanted to create a simple textarea input block but couldn't find anything to draw from so I copied the Content block from concrete/blocks/content and pasted, then modified, the pages in the blocks folder that sites outside of concrete/.

I can input text and click Add and everything works fine... until I go to edit the block and click Add. Then I get this:

Fatal error: main() [<a href='function.main'>function.main</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;HomeModuleBlockController&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/sites1/sites1.com/client/concrete/startup/process.php on line 515

No idea what this means, can anyone help? Thanks so much.

stephmars
 
zoinks replied on at Permalink Reply
From my handy-dandy Concrete5 QuickTips sheet:

3. Editable Areas = any area you want to add which allows the user to add images, text, video, etc.

Just add this code in your HTML where you want the block to appear:

<?php $a = new Area('Content Name'); $a->display($c); ?>



'Content Name' is whatever name you choose to give it. Make each area unique on the page.
nteaviation replied on at Permalink Reply
nteaviation
Your custom block controller file should be named /blocks/home_module.php (just as shown, all lowercase with underscores before Uppercase characters). I bet it is not.
stephmars replied on at Permalink Reply
stephmars
When I rename controller.php to home_module.php and refresh the database, this is the error I get:

The following errors occurred when attempting to process your request:

* No block found with the handle homemodule found.
nteaviation replied on at Permalink Best Answer Reply
nteaviation
So sorry, the directory that holds your custom block files must be named /blocks/home_module, rename your controller file back to controller.php Your class definition should look like this
class HomeModuleBlockController extends BlockController {
stephmars replied on at Permalink Reply
stephmars
THIS WORKED!

Thank you so very much. Thank you thank you!
nteaviation replied on at Permalink Reply
nteaviation
Glad I could help! Sometimes I get lucky :)
stephmars replied on at Permalink Reply
stephmars
Yep, had that! Still doesn't work. :( But thanks.
nteaviation replied on at Permalink Reply
nteaviation
Does it still throw that error if you turn site cache off?