Hi,
I'm trying to build a module called ProductOptions, but I can't get the ListView to work properly. At the moment it displays as many rows as there are in the db, but completely blank.
It also shows these two errors for each row:
The stack trace just tells me that they come from this line in ListView.phpCode:Warning: Invalid argument supplied for foreach() in C:\SERVER\htdocs\sugarpro\data\SugarBean.php on line 2031 Warning: Invalid argument supplied for foreach() in C:\SERVER\htdocs\sugarpro\data\SugarBean.php on line 3947
The full ListView.php file is this:PHP Code:echo $lv->display();
...and here's listviewdefs.phpPHP Code:<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
$where = "";
require_once('modules/ProductOptions/ProductOption.php');
require_once('include/ListView/ListViewSmarty.php');
require_once('modules/ProductOptions/metadata/listviewdefs.php');
$seedProductOptions = new ProductOption();
$lv = new ListViewSmarty();
$lv->displayColumns = $listViewDefs['ProductOptions'];
$lv->setup($seedProductOptions,
'include/ListView/ListViewGeneric.tpl', $where,
$listViewDefs['ProductOptions']);
echo $lv->display();
?>
All the module's files are attached, if you're interested. Note that this is NOT an installable archive, though.PHP Code:<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not a valid entry point');
$listViewDefs['ProductOptions'] = array(
'NAME' => array(
'width' => '25',
'label' => 'LBL_NAME',
'default' => true,
'sortable' => true,
'orderBy' => true
),
'PRODUCT' => array(
'width' => '50',
'label' => 'LBL_PRODUCT',
'default' => true,
),
'TYPE' => array(
'width' => '25',
'label' => 'LBL_TYPE',
'default' => true,
)
);
?>
Just to clarify, here's a screenshot:
![]()
SugarPro Version is 4.5.1e (Build 1049) on Windows 2000
PHP Version is 5.1.2, database is MySQL 5
Web Server is Apache 2.2.0
Any help would be greatly appreciated,
Thanks
Jez


LinkBack URL
About LinkBacks




Reply With Quote
Bookmarks