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