Skip to content

Commit

Permalink
Merge pull request #391 from katzwebservices/bugfix/fix-1.8.1-syntax-…
Browse files Browse the repository at this point in the history
…error

Fixing an fatal error when rendering list-single.php
  • Loading branch information
zackkatz committed Jun 10, 2015
2 parents 3fe1129 + 5f66af2 commit 904855f
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 67 deletions.
4 changes: 2 additions & 2 deletions gravityview.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Plugin Name: GravityView
* Plugin URI: http://gravityview.co
* Description: Create directories based on a Gravity Forms form, insert them using a shortcode, and modify how they output.
* Version: 1.8.1
* Version: 1.8.2
* Author: Katz Web Services, Inc.
* Author URI: http://www.katzwebservices.com
* Text Domain: gravityview
Expand Down Expand Up @@ -71,7 +71,7 @@
*/
final class GravityView_Plugin {

const version = '1.8.1';
const version = '1.8.2';

public static $theInstance;

Expand Down
6 changes: 6 additions & 0 deletions includes/class-admin-welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ public function changelog_screen() {

<hr />

<h3>1.8.2 on June 10</h3>

<ul>
<li>Fixed: Error on <code>list-single.php</code> template</li>
</ul>

<h3>1.8.1 on June 9</h3>

<ul>
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Beautifully display your Gravity Forms entries. Learn more on [GravityView.co](h

== Changelog ==

= 1.8.2 =
* Fixed: Error on `list-single.php` template

= 1.8.1 on June 9 =
* Added: New search filter for Date fields to allow searching over date ranges ("from X to Y")
* Updated: The minimum required version of Gravity Forms is now 1.8.7. **GravityView will be requiring Gravity Forms 1.9 soon.** Please update Gravity Forms if you are running an older version!
Expand Down
126 changes: 61 additions & 65 deletions templates/list-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,88 +11,84 @@
<?php gravityview_before(); ?>

<div class="gv-container gv-list-single-container gv-list-container">

<p class="gv-back-link"><?php echo gravityview_back_link(); ?></p>

<?php foreach( $this->getEntries() as $entry ) {

<?php foreach ( $this->getEntries() as $entry ) {
$this->setCurrentEntry( $entry );
?>

<div id="gv_list_<?php echo $entry['id']; ?>" class="gv-list-view">

<?php if( $this->getFields('single_table-columns') ) { ?>
<?php if( $this->getFields('single_list-title') || $this->getFields('single_list-subtitle') ) { ?>
<div class="gv-list-view-title">

<?php

if( $fields = $this->getFields('single_list-title') ) {
$i = 0;
$title_args = array(
'entry' => $entry,
'form' => $this->form,
'hide_empty' => $this->atts['hide_empty'],
);
foreach( $fields as $field ) {
$title_args['field'] = $field;
if( $i == 0 ) {
$title_args['markup'] = '<h3 class="{{class}}">{{label}}{{value}}</h3>';
echo gravityview_field_output( $title_args );
} else {
$title_args['wpautop'] = true;
echo gravityview_field_output( $title_args );
}
$i++;
}
<?php
if ( $this->getFields( 'single_table-columns' ) ) {
if ( $this->getFields( 'single_list-title' ) || $this->getFields( 'single_list-subtitle' ) ) { ?>
<div class="gv-list-view-title">
<?php
if ( $fields = $this->getFields( 'single_list-title' ) ) {
$i = 0;
$title_args = array(
'entry' => $entry,
'form' => $this->form,
'hide_empty' => $this->atts['hide_empty'],
);
foreach ( $fields as $field ) {
$title_args['field'] = $field;
if ( 0 === $i ) {
$title_args['markup'] = '<h3 class="{{class}}">{{label}}{{value}}</h3>';
echo gravityview_field_output( $title_args );
} else {
$title_args['wpautop'] = true;
echo gravityview_field_output( $title_args );
}
$i++;
}
}

$this->renderZone('subtitle', array(
'wrapper_class' => 'gv-list-view-subtitle',
'markup' => '<h4 class="{{class}}">{{label}}{{value}}</h4>'
));

?>
</div>
<?php } ?>

<div class="gv-list-view-content">
<?php
$this->renderZone('subtitle', array(
'wrapper_class' => 'gv-list-view-subtitle',
'markup' => '<h4 class="{{class}}">{{label}}{{value}}</h4>',
));

$this->renderZone('image', array(
'wrapper_class' => 'gv-list-view-content-image',
'markup' => '<h4 class="{{class}}">{{label}}{{value}}</h4>'
));
?>
</div>
<?php
}
}
?>

$this->renderZone('description', array(
'wrapper_class' => 'gv-list-view-content-description',
'label_markup' => '<h4>{{label}}</h4>',
'wpautop' => true
));
<div class="gv-list-view-content">
<?php

$this->renderZone('content-attributes', array(
'wrapper_class' => 'gv-list-view-content-attributes',
'markup' => '<p class="{{class}}">{{label}}{{value}}</p>'
));
$this->renderZone('image', array(
'wrapper_class' => 'gv-list-view-content-image',
'markup' => '<h4 class="{{class}}">{{label}}{{value}}</h4>',
));

?>
</div>
$this->renderZone('description', array(
'wrapper_class' => 'gv-list-view-content-description',
'label_markup' => '<h4>{{label}}</h4>',
'wpautop' => true,
));

<?php if( $this->getFields('single_list-footer-left') || $this->getFields('single_list-footer-right') ) { ?>
$this->renderZone('content-attributes', array(
'wrapper_class' => 'gv-list-view-content-attributes',
'markup' => '<p class="{{class}}">{{label}}{{value}}</p>',
));

<div class="gv-grid gv-list-view-footer">
<div class="gv-grid-col-1-2 gv-left">
<?php $this->renderZone('footer-left'); ?>
</div>
?>
</div>

<div class="gv-grid-col-1-2 gv-right">
<?php $this->renderZone('footer-right'); ?>
</div>
<?php if ( $this->getFields( 'single_list-footer-left' ) || $this->getFields( 'single_list-footer-right' ) ) { ?>
<div class="gv-grid gv-list-view-footer">
<div class="gv-grid-col-1-2 gv-left">
<?php $this->renderZone( 'footer-left' ); ?>
</div>

<?php } ?>
<div class="gv-grid-col-1-2 gv-right">
<?php $this->renderZone( 'footer-right' ); ?>
</div>
</div>
<?php } ?>

</div>
</div>

<?php } // End foreach $this->getEntries() ?>

Expand Down

0 comments on commit 904855f

Please sign in to comment.