Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nomand opened this issue Jul 11, 2016 · 2 comments
Open

Comments

@nomand
Copy link

nomand commented Jul 11, 2016

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

@nomand
Copy link
Author

nomand commented Jul 11, 2016

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
Copy link

Seriously, how the hell did this not get noticed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants