Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#76 php Warning in Pager_Columns.php after install

gabriel maranca

I downloaded and installed xrms for the first time. I am using a PC with Vista and IIS, mysql, PHP, PEAR.

After completing the installation I was able to log in as user1

Several menus appear to work but something must be wrong with the columns handling. When I choose Activities I get these two warnings:

HP Warning: array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object in C:\inetpub\wwwroot\xrms\include\classes\Pager\Pager_Columns.php on line 558

PHP Warning: Invalid argument supplied for foreach() in C:\inetpub\wwwroot\xrms\include\classes\Pager\Pager_Columns.php on line 575

Same issue when I click on Browse on Home menu. I get the second warning if I choose Companies or Contacts.

Do I need to load some data perhaps?

I think the first error is encountered in this piece of code

* Function to call when retrieving the criteria set on a view
* Retrieves the current view data criteria if no view name is provided
* Only returns the criteria if it is provided in the view data
* This means criteria is only returned when the view is being loaded (load button clicked)
* @return array with view criteria, as passed in/saved with the view
function GetViewCriteria($view_name=false) {
if (array_key_exists('criteria',$view_data)) {
return $view_data['criteria'];

return false;

The second error is encountered in this piece of code:

* Returns the sub-array of the initial pager_columns array to be used with the pager
* @return array pager_columns
function GetUserPagerColumns() {

$return_pager_columns = array();
$user_columns = $this->GetUserColumnNames();

foreach($user_columns as $user_column) {
if(isset($this->pager_columns[$user_column]['name'])) {
$return_pager_columns[] = $this->pager_columns[$user_column];
return $return_pager_columns;

Probably unrelated to this issue, but want to mention that the only problem I encountered during installation is a PHP error in i18n.php, it did not like the variable LC_MESSAGES so I had to change the statement: setlocale(LC_MESSAGES, $longlocale); to setlocale(LC_ALL, $longlocale);