Topic: Error in Config File

I received a Line 158 Error right after installation and could not login.
It took me a little while to figure out but there is a error in the default lines for the configuration.inc.php.
My installation is running on Clarkconnect 4.3 inside a flexshare folder.

At present the configuration file default variable only work if the  '__SUBDIRECTORY__' and '__VIRTUAL_DIRECTORY__'  match

The correction from the '__SUBDIRECTORY__' to '__VIRTUAL_DIRECTORY__' under the assets lines for CSS and JS assets is needed to properly use the '__VIRTUAL_DIRECTORY__' variable.

<?php
    // This is the "Pro" version of configuration.inc.php, without any comments, and restructured in a way
    // that should make sense for most pro-users of Qcodo
   
    // As always, feel free to use, change or ignore.

    define('SERVER_INSTANCE', 'dev');

    switch (SERVER_INSTANCE) {
        case 'dev':
        case 'test':
        case 'stage':
        case 'prod':
            define ('__DOCROOT__', '/var/flexshare/shares');
            define ('__VIRTUAL_DIRECTORY__', '/flexshare/tracmor');
            define ('__SUBDIRECTORY__', '/tracmor');

            define('DB_CONNECTION_1', serialize(array(
                'adapter' => 'MySqli5',
                'server' => 'localhost',
                'port' => null,
                'database' => 'db',
                'username' => 'username',
                'password' => 'passwrd',
                'profiling' => false)));
            break;
    }

    define('ALLOW_REMOTE_ADMIN', false);
    define ('__URL_REWRITE__', 'none');

    define ('__DEVTOOLS_CLI__', __DOCROOT__ . __SUBDIRECTORY__ . '/_devtools_cli');
    define ('__INCLUDES__', __DOCROOT__ .  __SUBDIRECTORY__ . '/includes');
    define ('__QCODO__', __INCLUDES__ . '/qcodo');
    define ('__QCODO_CORE__', __INCLUDES__ . '/qcodo/_core');
    define ('__DATA_CLASSES__', __INCLUDES__ . '/data_classes');
    define ('__DATAGEN_CLASSES__', __INCLUDES__ . '/data_classes/generated');
    define ('__FORMBASE_CLASSES__', __INCLUDES__ . '/formbase_classes_generated');
    define ('__PANELBASE_CLASSES__', __INCLUDES__ . '/panelbase_classes_generated');
    define ('__DEVTOOLS__', __SUBDIRECTORY__ . '/_devtools');
    define ('__FORM_DRAFTS__', __SUBDIRECTORY__ . '/form_drafts');
    define ('__PANEL_DRAFTS__', __SUBDIRECTORY__ . '/panel_drafts');

    // We don't want "Examples", and we don't want to download them during qcodo_update
    define ('__EXAMPLES__', null);

    define ('__JS_ASSETS__', __VIRTUAL_DIRECTORY__ . '/js');     // CHANGE THIS LINE
    define ('__CSS_ASSETS__', __VIRTUAL_DIRECTORY__ . '/css');     // CHANGE THIS LINE
    define ('__IMAGE_ASSETS__', __SUBDIRECTORY__ . '/images');
    define ('__PHP_ASSETS__', __SUBDIRECTORY__ . '/includes/php');

    if ((function_exists('date_default_timezone_set')) && (!ini_get('date.timezone')))
        date_default_timezone_set('America/Los_Angeles');

    define('ERROR_PAGE_PATH', __PHP_ASSETS__ . '/_core/error_page.php');
?>

Just a FYI and to help anyone else with this problem.

Re: Error in Config File

I changed the lines you listed, but I still get an error like below

Undefined index:  Qform__FormCallType
Error Type:   E_NOTICE

Source File:   /var/www/tracmor/includes/qcodo/_core/qform/QFormBase.class.php     Line:   158

Line 153:   
Line 154:                if ($objClass) {
Line 155:                    global $$strFormId;
Line 156:                    $$strFormId = $objClass;
Line 157:   
Line 158:                    $objClass->strCallType = $_POST['Qform__FormCallType'];
Line 159:                    $objClass->intFormStatus = QFormBase::FormStatusUnrendered;
Line 160:   
Line 161:                    if ($objClass->strCallType == QCallType::Ajax)
Line 162:                        QApplication::$RequestMode = QRequestMode::Ajax;
Line 163:   


I have the tracmor folder setup as follows on my dev box;
/var/www/tracmor

My variables are defines as;
            define ('__DOCROOT__', '/var/www/tracmor');
            define ('__VIRTUAL_DIRECTORY__', 'tracmor');
            define ('__SUBDIRECTORY__', '');

            define('DB_CONNECTION_1', serialize(array(
                'adapter' => 'MySqli5',
                'server' => 'localhost',
                'port' => null,
                'database' => 'tracmor',
                'username' => 'xxxx',
                'password' => 'yyyy',
                'profiling' => false)));




Any ideas?

Re: Error in Config File

The default values in the configuration.inc.php file are there only as an example and are not intended to work "out of the box".  The Installation Instructions give instructions on what settings need to be modified to get a working installation.

Justin Sinclair

Got Inventory? Get Tracmor.