Results 1 to 3 of 3

Thread: Blank rows in ListView

  1. #1
    jezz is offline Junior Member
    Join Date
    May 2007
    Posts
    3

    Default Blank rows in ListView

    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:
    Code:
    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 stack trace just tells me that they come from this line in ListView.php
    PHP Code:
    echo $lv->display(); 
    The full ListView.php file is this:
    PHP 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();

    ?>
    ...and here's listviewdefs.php
    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,
            )
        );
            
    ?>
    All the module's files are attached, if you're interested. Note that this is NOT an installable archive, though.

    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
    Attached Files Attached Files
    Last edited by jezz; 2007-07-12 at 02:52 PM.

  2. #2
    jezz is offline Junior Member
    Join Date
    May 2007
    Posts
    3

    Default Re: Blank rows in ListView

    An update...

    I've discovered this line in the listview stack trace...

    Code:
    Notice: Undefined index: NAME occured in C:\SERVER\htdocs\sugarpro\cache\smarty\templates_c\%%78^786^7862BF8C%%ListViewGeneric.tpl.php on line 241 [2007-07-13 09:20:04]
    C:\SERVER\htdocs\sugarpro\cache\smarty\templates_c\%%78^786^7862BF8C%%ListViewGeneric.tpl.php[L:241](:StackTraceErrorHandler)
    C:\SERVER\htdocs\sugarpro\include\Smarty\Smarty.class.php[L:1265](:include)
    C:\SERVER\htdocs\sugarpro\include\ListView\ListViewSmarty.php[L:186](Smarty:fetch)
    C:\SERVER\htdocs\sugarpro\modules\ProductOptions\ListView.php[L:17](ListViewSmarty:display)
    C:\SERVER\htdocs\sugarpro\modules\ProductOptions\index.php[L:13](:include)
    C:\SERVER\htdocs\sugarpro\index.php[L:789](:include)
    ...and similar lines for the other columns(''PRODUCT', 'TYPE') . Presumably these refer to the entries in the listviewdefs.php file, and for some reason they aren't being properly defined.

    Thanks in advance.

    Jez

  3. #3
    knabours is offline Junior Member
    Join Date
    Nov 2007
    Posts
    1

    Default Re: Blank rows in ListView

    I too was getting those errors.

    Fixed by making sure the following 4 lines were in the Bean.

    var $table_name = "ProductOptions";
    var $object_name = "ProductOption";
    var $object_names = "ProductOptions";
    var $module_dir = "ProductOptions";

    or whatever your using.

    That got rid of the error messages.
    I still kept getting blank lines, until I changed the listviewdefs.php to have all caps for the fields. But, you already seem to have that, so not sure if just that problem above would fix it or not.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Same record multible times in Listview
    By jones70 in forum Help
    Replies: 5
    Last Post: 2011-01-28, 04:47 AM
  2. Replies: 2
    Last Post: 2009-09-13, 11:22 AM
  3. Replies: 14
    Last Post: 2007-05-29, 11:09 PM
  4. Replies: 2
    Last Post: 2007-02-03, 12:05 AM
  5. Serious issue with sugarcrm 3.5.1.c
    By wp.rauchholz in forum Help
    Replies: 17
    Last Post: 2005-12-01, 07:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •