Error when adding custom block to a page
Permalink 1 user found helpful
I have a custom block that I have built that's pretty simple. I've used it before on previous version of C5 without issues. However, when I add it to a page on Concrete 5.4.0.5, I get the following error:
Any ideas as to what might cause this? As far as I know, everything in the block looks okay. Here is the block controller if that gives any insight:
As you can see, it's pretty simple. Any help would be greatly appreciated.
Fatal error: method_exists() [<a href='function.method-exists'>function.method-exists</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "RelatedLinksBlockController" 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 /var/www/concrete-core/5.4.0.5/libraries/database_indexed_search.php on line 113
Any ideas as to what might cause this? As far as I know, everything in the block looks okay. Here is the block controller if that gives any insight:
class RelatedLinksBlockController extends BlockController { var $pobj; protected $btTable = 'btRelatedLinks'; protected $btInterfaceWidth = "600"; protected $btInterfaceHeight = "280"; public function getBlockTypeDescription() { return t("Formats a links of related links to be displayed in the right hand column on MC template sites."); } public function getBlockTypeName() { return t("Related Links"); } }
As you can see, it's pretty simple. Any help would be greatly appreciated.
The camel case was it. Thanks nteaviation.
Glad to help :) Andrew (http://www.concrete5.org/profile/-/4/... ) deserves all the credit
I ran into a similar problem, except that I named my block superimage instead of super_image, with my class called SuperImageBlockController. So it seems the underscore must align with each case shift?
Anyway, thanks, this got me on the right track!
Anyway, thanks, this got me on the right track!
Yes, with camel casing,
the letter at the beggining and after an underscore need to be capitalized
omg_this_is_cool ->OmgThisIsCool
the letter at the beggining and after an underscore need to be capitalized
omg_this_is_cool ->OmgThisIsCool
This might be obvious, but I just wanted to point out that this error can also be caused by a block name that uses capitalized initials. For example, if you have a block named MyABCBlock and you're getting this error, try renaming the controller class to MyAbcBlock and the folder name to my_abc_block.
http://www.concrete5.org/community/forums/customizing_c5/cache-prob...
I had our custom block directories incorectly named to match the camel-case class definition in our controller.php. Is your custom block folder/directory named "related_links"? Hope it helps...