Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG Check for the parameter existence.

The specific situation is if the SearchForm.ss is overriden, and the
$SearchQuery parameter is used in the template. This will throw a Notice
in case the form is rendered without searching.
  • Loading branch information...
commit ee2b1a9070e4c49466b8a6c9f98bf7de23874934 1 parent abc87a4
@mateusz mateusz authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  code/search/SearchForm.php
View
3  code/search/SearchForm.php
@@ -172,7 +172,8 @@ public function getSearchQuery($data = null) {
// legacy usage: $data was defaulting to $_REQUEST, parameter not passed in doc.silverstripe.org tutorials
if(!isset($data)) $data = $_REQUEST;
- return Convert::raw2xml($data['Search']);
+ // The form could be rendered without the search being done, so check for that.
+ if (isset($data['Search'])) return Convert::raw2xml($data['Search']);
}
/**

0 comments on commit ee2b1a9

Please sign in to comment.
Something went wrong with that request. Please try again.