[fixed] 1.10 Beta3: News $entry->category wrong on detail

The members of the Dev team will place issues here that they consider to be solved.
Post Reply
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am

[fixed] 1.10 Beta3: News $entry->category wrong on detail

Post by fredp »

Hello again,

I just noticed that News articles displayed on a detail page always seem to have the same category displayed (i.e. "General").

I tracked the problem down to a typo in modules/News/lib/class.news_ops.php (assignment operator instead of equality operator):

Code: Select all

  public static function get_category_name_from_id($id)
  {
    self::get_category_list();
    for( $i = 0; $i < count(self::$_cached_categories); $i++ )
      {
        if( $id = self::$_cached_categories[$i]['news_category_id'] )
          {
            return self::$_cached_categories[$i]['news_category_name'];
          }
      }
  }
The first line of the if statement should read:

Code: Select all

        if( $id == self::$_cached_categories[$i]['news_category_id'] )
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
uniqu3

Re: CMSMS 1.10 Beta3: News $entry->category wrong on detail

Post by uniqu3 »

Thank you fredp.

Should be fixed in SVN 7423
Post Reply

Return to “Closed Issues”