Completed
Pull Request — master (#874)
by
unknown
11:13 queued 07:04
created
future/_mocks.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -94,15 +94,15 @@  discard block
 block discarded – undo
94 94
 		$paging = rgar( $parameters, 'paging' );
95 95
 	} else {
96 96
 		$entries = $form->entries
97
-			->filter( \GV\GF_Entry_Filter::from_search_criteria( $criteria['search_criteria'] ) )
98
-			->offset( $args['offset'] )
99
-			->limit( $criteria['paging']['page_size'] )
100
-			->page( ( ( $criteria['paging']['offset'] - $args['offset'] ) / $criteria['paging']['page_size'] ) + 1 );
101
-		if ( ! empty( $criteria['sorting'] ) ) {
97
+			->filter( \GV\GF_Entry_Filter::from_search_criteria( $criteria[ 'search_criteria' ] ) )
98
+			->offset( $args[ 'offset' ] )
99
+			->limit( $criteria[ 'paging' ][ 'page_size' ] )
100
+			->page( ( ( $criteria[ 'paging' ][ 'offset' ] - $args[ 'offset' ] ) / $criteria[ 'paging' ][ 'page_size' ] ) + 1 );
101
+		if ( ! empty( $criteria[ 'sorting' ] ) ) {
102 102
 			$field = new \GV\Field();
103
-			$field->ID = $criteria['sorting']['key'];
104
-			$direction = strtolower( $criteria['sorting']['direction'] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC;
105
-			$mode = $criteria['sorting']['is_numeric'] ? \GV\Entry_Sort::NUMERIC : \GV\Entry_Sort::ALPHA;
103
+			$field->ID = $criteria[ 'sorting' ][ 'key' ];
104
+			$direction = strtolower( $criteria[ 'sorting' ][ 'direction' ] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC;
105
+			$mode = $criteria[ 'sorting' ][ 'is_numeric' ] ? \GV\Entry_Sort::NUMERIC : \GV\Entry_Sort::ALPHA;
106 106
 			$entries = $entries->sort( new \GV\Entry_Sort( $field, $direction, $mode ) );
107 107
 		}
108 108
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
 /** Add some global fix for field capability discrepancies. */
130 130
 add_filter( 'gravityview/configuration/fields', function( $fields ) {
131
-	if ( empty( $fields  ) ) {
131
+	if ( empty( $fields ) ) {
132 132
 		return $fields;
133 133
 	}
134 134
 
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
 		}
156 156
 
157 157
 		foreach ( $_fields as $uid => &$_field ) {
158
-			if ( ! isset( $_field['only_loggedin'] ) ) {
158
+			if ( ! isset( $_field[ 'only_loggedin' ] ) ) {
159 159
 				continue;
160 160
 			}
161 161
 			/** If we do not require login, we don't require a cap. */
162
-			$_field['only_loggedin'] != '1' && ( $_field['only_loggedin_cap'] = '' );
162
+			$_field[ 'only_loggedin' ] != '1' && ( $_field[ 'only_loggedin_cap' ] = '' );
163 163
 		}
164 164
 	}
165 165
 	return $fields;
Please login to merge, or discard this patch.