Results 1 to 6 of 6

Thread: Version 6.2.4 Studio - errors - History.php on line 72

  1. #1
    lzwaan is offline Junior Member
    Join Date
    Oct 2011
    Posts
    5

    Default Version 6.2.4 Studio - errors - History.php on line 72

    Everything works accept Development Tool Studio, it throws multiple (the same) errors (all the same) like below:

    Warning: Invalid argument supplied for foreach() in /public_html/zr-crm/modules/ModuleBuilder/parsers/views/History.php on line 72

    Warning: Invalid argument supplied for foreach() in /public_html/zr-crm/modules/ModuleBuilder/parsers/views/History.php on line 72

    Warning: Invalid argument supplied for foreach() in /public_html/zr-crm/modules/ModuleBuilder/parsers/views/History.php on line 72

    Warning: Invalid argument supplied for foreach() in /public_html/zr-crm/modules/ModuleBuilder/parsers/views/History.php on line 72

    Warning: Invalid argument supplied for foreach() in /public_html/zr-crm/modules/ModuleBuilder/parsers/views/History.php on line 72

    Warning: Invalid argument supplied for foreach() in /public_html/zr-crm/modules/ModuleBuilder/parsers/views/History.php on line 72

    Tried to work with 6.2.3 -> it's ok!

    Does anybody knows what is should do?
    I already empty the cache and did also repair -> no luck.

    Kind regards,

    Lars

  2. #2
    ian.teohsc is offline Junior Member
    Join Date
    Nov 2011
    Posts
    1

    Default Re: Version 6.2.4 Studio - errors - History.php on line 72

    I modified the History.php file. Added a check for is_array before proceeding at line 72 (modified section in red):

    $filebytimestamp = glob($this->getFileByTimestamp('*'));
    if (is_array($filebytimestamp)){
    foreach ($filebytimestamp as $filename)

    {
    if(preg_match('/(\d+)$/', $filename, $match)) {
    $this->_list [] = $match[1];
    }
    }
    }

  3. #3
    onastvar is offline Junior Member
    Join Date
    Nov 2011
    Posts
    1

    Question Re: Version 6.2.4 Studio - errors - History.php on line 72

    Hello,

    I was getting same error - History.php on line 72, I modified History.php (red code) but now I'm getting the following: Parse error: syntax error, unexpected T_PUBLIC in /crm/modules/ModuleBuilder/parsers/views/History.php on line 93. Would anyone know what could be causing this issue? I'm using SUGAR COMMUNITY EDITION - Version 6.4.0beta3 (Build 7099). This is the code from /crm/modules/ModuleBuilder/parsers/views/History.php (line 72 to 95)
    Code:
                // Reconstruct the history from the saved files
    			$filebytimestamp = glob($this->getFileByTimestamp('*'));
    			if (is_array($filebytimestamp)){
     	        foreach ($filebytimestamp as $filename)
                {
                     if(preg_match('/(\d+)$/', $filename, $match)) {
     	                $this->_list [] = $match[1];
                     }
                }
            }
            // now sort the files, oldest first
            if (count ( $this->_list ) > 0)
            {
                sort ( $this->_list ) ;
            }
        }
    
    
     /*
         * Get the most recent item in the history
         * @return timestamp of the first item
         */
        public function getCount ()
        {
            return count ( $this->_list ) ;
    Thank You

  4. #4
    ludwing is offline Junior Member
    Join Date
    Jul 2008
    Posts
    4

    Exclamation Re: Version 6.2.4 Studio - errors - History.php on line 72

    Same problem is happening in 6.3.0.

    Warning: Invalid argument supplied for foreach() in /home/mendelne/public_html/crm/modules/ModuleBuilder/parsers/views/History.php on line 72

    mulitple...

    Can't even design at all in 6.4.0 beta 4...

    Anybody know a solution for these error?

    please pm me thank you.

  5. #5
    Vince is offline Sugar Community Member
    Join Date
    Jul 2004
    Posts
    92

    Smile Re: Version 6.2.4 Studio - errors - History.php on line 72

    Hello,

    With 6.3.0 I did this little code modification.
    PHP Code:
    ...
              if (
    glob($this->getFileByTimestamp('*')) !== FALSE) {
                  
    $filenameList glob($this->getFileByTimestamp('*'));
              } else {
                  
    $filenameList = array();
              }
              foreach (
    $filenameList as $filename)
                {
    ... 
    HTH

    Vince
    SYNOLIA
    Oldest SugarCRM partner in the world and Gold Partner / Partenaire GOLD SugarCRM
    Official French Translator / Responsable de la traduction Française

    51 Avenue Jean Jaurès - 69007 LYON - FRANCE - Tel : +33 4 27 70 53 70
    www.synolia.com | @synolia sur Twitter
    www.crm-france.com | Forum CRM-France

  6. #6
    releasetms is offline Junior Member
    Join Date
    Mar 2011
    Posts
    2

    Default Re: Version 6.2.4 Studio - errors - History.php on line 72

    Just my 2 cents.. In stead of executing the function that does file I/O's (slow processes..) I would do it once.. then check and replace it with an empty array(), save some resources..

    PHP Code:
    $filenameList glob($this->getFileByTimestamp('*'));
              if (
    $filenameList == FALSE) {
                  
    $filenameList = array();
              }
              foreach (
    $filenameList as $filename)
                {
                     if(
    preg_match('/(\d+)$/'$filename$match)) {
                         
    $this->_list [] = $match[1];
                     }
                } 

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 2011-12-14, 02:13 PM
  2. Replies: 0
    Last Post: 2011-09-15, 11:42 PM
  3. Line Items with Enhanced Studio 3.1
    By thamim in forum Help
    Replies: 1
    Last Post: 2010-04-09, 01:12 PM
  4. Errors on Install. (nusoap.php on line 2162)
    By Gago in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2007-12-07, 12:46 PM
  5. Opportunity errors in version 4
    By Oracledarren in forum Help
    Replies: 2
    Last Post: 2005-12-16, 04:34 PM

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
  •