Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Value is missing for fieldspec['type']
Value is missing for fieldspec['type'] [message #5177] Fri, 27 November 2015 08:36 Go to previous message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
This error can be replicated as follows:
1. Configure Radicore v1.91 with 2 database servers: mysql and sqlsrv
2. On mysql server: Run the system databases 'audit', 'dict', 'menu' and 'workflow'
3. On sqlsrv server: Create a custom database 'testdb' with a table 'testtbl' with some arbitrary fields and a field 'testnum' of type 'numeric'
4. Create a new subsystem, import the custom database 'testdb', table 'testtbl' and its columns
5. In the Tables tab Select 'testtbl', click "Export to PHP" button will result in error message: "[testnum] Value is missing for fieldspec['type']"

Error trace:
This error can be traced back to function _createFieldSpecs in file dict_table_s02.class.inc
The function calls $this->_ddl_getColumnSpecs() which returns the ColumnSpecs for mysql rather than sqlsrv, which results in error because ColumnSpecs of mysql do not have 'numeric' type.

Proposed fix:
1. In file std.table.class.inc, change
    function _ddl_getColumnSpecs ()
    // obtain column specifications.
    {
        $DDL =& $this->_getDBMSengine($this->dbname);

        $array = $DDL->ddl_getColumnSpecs();

        return $array;

    } // _ddl_getColumnSpecs
to
    function _ddl_getColumnSpecs ($dbname=null)
    // obtain column specifications.
    {
    	if ($dbname === null) $dbname = $this->dbname;
    	$DDL =& $this->_getDBMSengine($dbname);
    	
        $array = $DDL->ddl_getColumnSpecs();

        return $array;

    } // _ddl_getColumnSpecs

2. In function _createFieldSpecs of file dict_table_s02.class.inc, change
$this->_ddl_getColumnSpecs()
to
$this->_ddl_getColumnSpecs($column_array[0]['database_id'])

 
Read Message
Read Message
Previous Topic: Error with bitwise operation
Next Topic: preg_replace operation distorts multibyte unicode characters
Goto Forum:
  


Current Time: Wed Dec 04 21:17:52 EST 2024

Total time taken to generate the page: 0.00905 seconds