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 "HomeModuleBlockController" 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.
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 "HomeModuleBlockController" 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.
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.
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.
The following errors occurred when attempting to process your request:
* No block found with the handle homemodule found.
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 {
THIS WORKED!
Thank you so very much. Thank you thank you!
Thank you so very much. Thank you thank you!
Glad I could help! Sometimes I get lucky :)
Yep, had that! Still doesn't work. :( But thanks.
Does it still throw that error if you turn site cache off?
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.