Thread: Debug errors

Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Debug errors

    I really need help with debug errors I am getting. I know it must be from the add on - News Article Summary.

    PHP Warning: Missing argument 2 for newsDisplay::newsHeader(), called in /includes/templates/mytempname/templates/tpl_news_article_default.php on line 35 and defined in /includes/classes/news.php on line 27

    Here is tpl_news_article_default.php some before and after line 35:
    HTML Code:
    <?php
    	// Start the news display class
    	$newsDisplay = new newsDisplay();
    
    	// News header
    	$newsDisplay->newsHeader(HEADING_TITLE);
    
    	// Set article heading
    	$newsDisplay->articleHeading($articleName);
    
    	// Set by line
    	$newsDisplay->articleByLine(sprintf(TEXT_ARTICLE_BY_LINE, $articleAuthor), $commentsURL, (($comments > 0) ? sprintf(TEXT_POST_COMMENT_1, $comments) : TEXT_POST_COMMENT_2));
    
    	// Set article main text
    	$newsDisplay->articleText($articleText, $articleImage);
    
    	// Set article links
    	$newsDisplay->articleLinksBlock($articleLinks);
    
    	$newsDisplay->articleSplit();
    
    	// News SubFooter
    	$newsDisplay->articleFooter(sprintf(TEXT_NEWS_FOOTER_OTHER, $newsSubFooterDate), $newsSubFooter, $newsSubFooterDateURL, sprintf(TEXT_NEWS_FOOTER_URL, $newsSubFooterDate));
    
    	// News Footer
    	$newsDisplay->articleFooter(sprintf(TEXT_NEWS_FOOTER, $newsFooterDate), $newsFooter, $newsFooterDateURL, sprintf(TEXT_NEWS_FOOTER_URL, $newsFooterDate));
    
    	// Recent News Footer
    	$newsDisplay->articleFooter(TEXT_RECENT_NEWS, $newsRecentFooter);
    
    	// Archive link
    	$newsDisplay->archiveLink(zen_href_link(FILENAME_NEWS_ARCHIVE), TEXT_NEWS_ARCHIVE_LINK);
    
    	// Display this news page
    	// New page content is output in valid XHTML
    	// You can change how it displays in the stylesheet_news.css file
    	$newsDisplay->displayNewsPage();
    ?></div>
    Here is /includes/classes/news.php on line 27:

    PHP Code:
    }

            function 
    newsHeader($header$date$links_array false) {
                
    $this->news_page .= '<div class="newsHeader"><h1>' $header '</h1></div>' "\n";
                
    $this->news_page .= '<div class="newsHeadlineText">' $date;

                if (
    $links_array && is_array($links_array)) {
                    foreach (
    $links_array as $link) {
                        
    $this->news_page .= ' | <a href="' $link['link'] . '">' $link['text'] . '</a>';
                    }
                } 
    PHP Warning: Invalid argument supplied for foreach() in /includes/classes/news.php on line 103

    Line 103 and little before it and after looks like this:
    HTML Code:
    		}
    
    		function articleLinksBlock($links_block) {
    			foreach ($links_block as $links) {
    				$this->news_page .= '<ul class="articleLinkList">' . "\n";
    
    				// Offsite Links
    				foreach ($links['offsiteLinks'] as $thisLink) {
    					$this->news_page .= '  <li><a href="' . $thisLink['link'] . '" target="_blank">' . $thisLink['text'] . '</a></li>' . "\n";
    				}
    Hope this helps! Kim

  2. #2
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Debug errors

    Quote Originally Posted by kburner View Post
    I really need help with debug errors I am getting. I know it must be from the add on - News Article Summary.

    PHP Warning: Missing argument 2 for newsDisplay::newsHeader(), called in /includes/templates/mytempname/templates/tpl_news_article_default.php on line 35 and defined in /includes/classes/news.php on line 27

    Here is tpl_news_article_default.php some before and after line 35:
    HTML Code:
    <?php
    	// Start the news display class
    	$newsDisplay = new newsDisplay();
    
    	// News header
    	$newsDisplay->newsHeader(HEADING_TITLE);
    
    	// Set article heading
    	$newsDisplay->articleHeading($articleName);
    
    	// Set by line
    	$newsDisplay->articleByLine(sprintf(TEXT_ARTICLE_BY_LINE, $articleAuthor), $commentsURL, (($comments > 0) ? sprintf(TEXT_POST_COMMENT_1, $comments) : TEXT_POST_COMMENT_2));
    
    	// Set article main text
    	$newsDisplay->articleText($articleText, $articleImage);
    
    	// Set article links
    	$newsDisplay->articleLinksBlock($articleLinks);
    
    	$newsDisplay->articleSplit();
    
    	// News SubFooter
    	$newsDisplay->articleFooter(sprintf(TEXT_NEWS_FOOTER_OTHER, $newsSubFooterDate), $newsSubFooter, $newsSubFooterDateURL, sprintf(TEXT_NEWS_FOOTER_URL, $newsSubFooterDate));
    
    	// News Footer
    	$newsDisplay->articleFooter(sprintf(TEXT_NEWS_FOOTER, $newsFooterDate), $newsFooter, $newsFooterDateURL, sprintf(TEXT_NEWS_FOOTER_URL, $newsFooterDate));
    
    	// Recent News Footer
    	$newsDisplay->articleFooter(TEXT_RECENT_NEWS, $newsRecentFooter);
    
    	// Archive link
    	$newsDisplay->archiveLink(zen_href_link(FILENAME_NEWS_ARCHIVE), TEXT_NEWS_ARCHIVE_LINK);
    
    	// Display this news page
    	// New page content is output in valid XHTML
    	// You can change how it displays in the stylesheet_news.css file
    	$newsDisplay->displayNewsPage();
    ?></div>
    Here is /includes/classes/news.php on line 27:

    PHP Code:
    }

            function 
    newsHeader($header$date$links_array false) {
                
    $this->news_page .= '<div class="newsHeader"><h1>' $header '</h1></div>' "\n";
                
    $this->news_page .= '<div class="newsHeadlineText">' $date;

                if (
    $links_array && is_array($links_array)) {
                    foreach (
    $links_array as $link) {
                        
    $this->news_page .= ' | <a href="' $link['link'] . '">' $link['text'] . '</a>';
                    }
                } 
    PHP Warning: Invalid argument supplied for foreach() in /includes/classes/news.php on line 103

    Line 103 and little before it and after looks like this:
    HTML Code:
    		}
    
    		function articleLinksBlock($links_block) {
    			foreach ($links_block as $links) {
    				$this->news_page .= '<ul class="articleLinkList">' . "\n";
    
    				// Offsite Links
    				foreach ($links['offsiteLinks'] as $thisLink) {
    					$this->news_page .= '  <li><a href="' . $thisLink['link'] . '" target="_blank">' . $thisLink['text'] . '</a></li>' . "\n";
    				}
    Hope this helps! Kim
    Can anyone with php knowledge help?

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Debug errors

    I don't know anything about your code, but I see:
    Code:
    	$newsDisplay->newsHeader(HEADING_TITLE);
    and I see:
    Code:
            function newsHeader($header, $date, $links_array = false) {
    which makes me think you need to pass a date in the first one or you will get an error ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Debug errors

    Quote Originally Posted by Ajeh View Post
    I don't know anything about your code, but I see:
    Code:
    	$newsDisplay->newsHeader(HEADING_TITLE);
    and I see:
    Code:
            function newsHeader($header, $date, $links_array = false) {
    which makes me think you need to pass a date in the first one or you will get an error ...
    Do you know what that would be or could take the date out?
    Thank you, Kim

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Debug errors

    No idea ... I have no clue about this code you are using ...

    I just see that you are calling that function with one parameter and it is expecting at least two ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Debug errors

    Quote Originally Posted by Ajeh View Post
    No idea ... I have no clue about this code you are using ...

    I just see that you are calling that function with one parameter and it is expecting at least two ...
    Hello.

    I went back through and took all the files out (except sql) and reloaded everything. All errors are gone. Not sure why files did not load the first time. I use filezilla.

    I only have one error left on my debug file. I think it has to do with the product book module. Do you have any idea how to help with this one?

    PHP Code:
    PHP Warning:  constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant ISBN in /includes/init_includes/overrides/init_add_crumbs.php on line 47 
    File detail for includes/init_includes/init_includes/init_add_crumbs.php
    PHP Code:
    /**
     * add get terms (e.g manufacturer, music genre, record company or other user defined selector) to breadcrumb
     */
    $sql "select *
            from " 
    TABLE_GET_TERMS_TO_FILTER;
    $get_terms $db->execute($sql);
    while (!
    $get_terms->EOF) {
        if (isset(
    $_GET[$get_terms->fields['get_term_name']])) {
            
    $sql "select " $get_terms->fields['get_term_name_field'] . "
                    from " 
    constant($get_terms->fields['get_term_table']) . "
                    where " 
    $get_terms->fields['get_term_name'] . " =  " . (int)$_GET[$get_terms->fields['get_term_name']];
            
    $get_term_breadcrumb $db->execute($sql);
        if (
    $get_term_breadcrumb->RecordCount() > 0) {
          
    $breadcrumb->add($get_term_breadcrumb->fields[$get_terms->fields['get_term_name_field']], zen_href_link(FILENAME_DEFAULT$get_terms->fields['get_term_name'] . "=" $_GET[$get_terms->fields['get_term_name']]));
        }
        }
        
    $get_terms->movenext();


    Here it is in the override file:

    PHP Code:
    /**
     * add get terms (e.g manufacturer, music genre, record company or other user defined selector) to breadcrumb
     */
    $sql "select *
            from " 
    TABLE_GET_TERMS_TO_FILTER;
    $get_terms $db->execute($sql);
    while (!
    $get_terms->EOF) {
        if (isset(
    $_GET[$get_terms->fields['get_term_name']])) {
            
    $sql "select " $get_terms->fields['get_term_name_field'] . "
                    from " 
    constant($get_terms->fields['get_term_table']) . "
                    where " 
    $get_terms->fields['get_term_name'] . " =  " . (int)$_GET[$get_terms->fields['get_term_name']];
            
    $get_term_breadcrumb $db->execute($sql);
        if (
    $get_term_breadcrumb->RecordCount() > 0) { 
    Thank you!!!

 

 

Similar Threads

  1. v150 i just notice my debug errors. Can you help?
    By westdh in forum General Questions
    Replies: 1
    Last Post: 1 Sep 2012, 10:02 PM
  2. Authorize.net AIM still generating debug logs even with debug disabled
    By llynix in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 11 May 2010, 01:03 AM
  3. 2 Blank Pages? - Debug not reporting errors
    By WayOnHigh in forum General Questions
    Replies: 5
    Last Post: 15 Mar 2010, 09:13 PM
  4. Admin errors on fresh installation - module errors and language definition errors
    By etrader in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 5 Oct 2007, 09:05 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR