• 
      

    Fix an error on the review_detail page about an undefined variable.

    Review Request #1965 — Created Dec. 4, 2010 and submitted — Latest diff uploaded

    Information

    Review Board
    master

    Reviewers

    Fix an error on the review_detail page about an undefined variable.
    
    The recent collapsed reviews change could cause an undefined variable
    error, due to the incorrect assumption that the variable would be defined
    later. On review requests that have updates but no reviews, this wouldn't
    be the case. The reason for this is that we would declare this variable,
    last_timestamp, per review, instead of outside the reviews loop. This would
    also cause excess SQL statements.
    
    Now we declare it once before we loop over anything.
    
    This also consolidates some of the logic. We had nested ifs when they should
    themselves have been collapsed.
    Tested with my review request that had only change descriptions. It no longer
    crashed, and collapsing worked fine.