Callback class::method is invalid -> Error while createing new addon


Well-known member
I'm following furrman's tutorial:-

I've created file/folder structure as follows:-

library / SimpleText / Installer.php

Installer.php code:-

class SimpleText_Installer
    //Creating required tables in the database

    // $table = array('createQuery', 'dropQuery')

    protected static $table = array(
        'createQuery' => 'CREATE TABLE IF NOT EXISTS `xf_simple_text` (
                `simple_id` INT( 10 ) NOT NULL AUTO_INCREMENT,
                `simple_text` VARCHAR ( 200 ),
                `simple_date` INT( 10 ) UNSIGNED,
                PRIMARY KEY (`simple_id`)
            ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;',
        'dropQuery' => 'DROP TABLE IF EXISTS `xf_simple_text`'

    public static function install()
        $db = XenForo_Application::get('db');

    public static function uninstall()
        $db = XenForo_Application::get('db');

I saved the file, then went to admin control panel and created a new addon with following Information:-

Add-on ID: SimpleTextAddon
Title: Simple Text Add On
Version String: 1.0
Version ID: 1
Installation Code: SimpleText_Installer :: install
Uninstallation Code: SimpleText_Installer::uninstall

When I click 'Save Addon', I'm getting an error in overlay that says -

Please correct the following errors:
  • Callback SimpleText_Installer::install is invalid (Invalid Class).
  • Callback SimpleText_Installer::uninstall is invalid (Invalid Class).
I'm unable to figure out why is the system not accepting my class::method. Can someone tell me what's missing or wrong?

Chris D

XenForo developer
Staff member
Everything you have typed above looks correct, so my only assumption is that something must be typed different to how it it above.

e.g are you sure the folder where the PHP is is actually called SimpleText? Rather than simpletext? Or Simpletext? Are you sure it's spelt correctly?

Same goes with the file name. It will be case sensitive.


Well-known member
Bang on! My 'SimpleText' folder was at the same level as 'library'. Damn, I gotta get used to this new IDE. I moved SimpleText under library and it worked.

Should have be more careful.