ramiismail / dopresskit

presskit() - spend time making games, not press.
GNU General Public License v3.0
133 stars 50 forks source link

<histories> in game sheets outputs all child <history> entries twice. #47

Open nomand opened 8 years ago

nomand commented 8 years ago

When when using <histories><history><header></><text></></></> format in a game sheet, all paragraphs output twice.

nomand commented 8 years ago

sheet.php has this code twice:

for( $i = 0; $i < count($histories); $i++ ) { $header = $text ="";

foreach( $histories[$i]['history']->children() as $child )
{
    if( $child->getName() == "header" ) $header = $child;
    else if( $child->getName() == "text" ) $text = $child;
}
echo '<strong>'.$header.'</strong><p>'.$text.'</p>';

}

Except second block uses curly braces:

for( $i = 0; $i < count($histories); $i++ ) { $header = $text ="";

foreach( $histories[$i]['history']->children() as $child )
{
    if( $child->getName() == "header" ) { $header = $child; }
    else if( $child->getName() == "text" ) { $text = $child; }
}
echo '<strong>'.$header.'</strong><p>'.$text.'</p>';

}

I removed the second block, and it renders the page properly. Not sure if removing it breaks other stuff, but it definitely fixes the content duplicate issue.

paulcanning commented 7 years ago

Seriously, how the hell did this not get noticed?