Merge pull request #373 from m-bene/filterTermsUndefined

Fix 'Undefined index: filter' php warnings for filter view when
This commit is contained in:
Andrew Bauer 2014-04-07 15:24:54 -05:00
commit 221f9afa6c
4 changed files with 6 additions and 7 deletions

View File

@ -160,7 +160,7 @@ xhtmlHeaders(__FILE__, $SLANG['EventFilter'] );
<table id="fieldsTable" class="filterTable" cellspacing="0">
<tbody>
<?php
for ( $i = 0; $i < count($_REQUEST['filter']['terms']); $i++ )
for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['terms']); $i++ )
{
?>
<tr>

View File

@ -1,9 +1,8 @@
var deleteSavedFilterString = "<?= $SLANG['DeleteSavedFilter'] ?>";
function validateForm( form )
{
<?php
if ( count($_REQUEST['filter']['terms']) > 2 )
if ( isset ($_REQUEST['filter']) && count($_REQUEST['filter']['terms']) > 2 )
{
?>
var bracket_count = 0;
@ -27,7 +26,7 @@ for ( $i = 0; $i < count($_REQUEST['filter']['terms']); $i++ )
}
?>
<?php
for ( $i = 0; $i < count($_REQUEST['filter']['terms']); $i++ )
for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['terms']); $i++ )
{
?>
var val = form.elements['filter[terms][<?= $i ?>][val]'];

View File

@ -160,7 +160,7 @@ xhtmlHeaders(__FILE__, $SLANG['EventFilter'] );
<table id="fieldsTable" class="filterTable" cellspacing="0">
<tbody>
<?php
for ( $i = 0; $i < count($_REQUEST['filter']['terms']); $i++ )
for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['terms']); $i++ )
{
?>
<tr>

View File

@ -3,7 +3,7 @@ var deleteSavedFilterString = "<?= $SLANG['DeleteSavedFilter'] ?>";
function validateForm( form )
{
<?php
if ( count($_REQUEST['filter']['terms']) > 2 )
if ( isset ($_REQUEST['filter']) && count($_REQUEST['filter']['terms']) > 2 )
{
?>
var bracket_count = 0;
@ -27,7 +27,7 @@ for ( $i = 0; $i < count($_REQUEST['filter']['terms']); $i++ )
}
?>
<?php
for ( $i = 0; $i < count($_REQUEST['filter']['terms']); $i++ )
for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['terms']); $i++ )
{
?>
var val = form.elements['filter[terms][<?= $i ?>][val]'];