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 next 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'])

Re: Value is missing for fieldspec['type'] [message #5178 is a reply to message #5177] Sat, 28 November 2015 04:56 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Well spotted. That fix will be in the next release.

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


Current Time: Thu Apr 18 18:54:40 EDT 2024

Total time taken to generate the page: 0.00988 seconds