Skip to content

Instantly share code, notes, and snippets.

View sminnee's full-sized avatar

Sam Minnée sminnee

View GitHub Profile
Index: sapphire/forms/FieldSet.php
===================================================================
--- sapphire/forms/FieldSet.php (revision 90572)
+++ sapphire/forms/FieldSet.php (working copy)
@@ -418,7 +418,7 @@
* @return FieldSet
*/
function HiddenFields() {
- $hiddenFields = new FieldSet();
+ $hiddenFields = new HiddenFieldSet();
Index: sapphire/dev/Debug.php
===================================================================
--- sapphire/dev/Debug.php (revision 91433)
+++ sapphire/dev/Debug.php (working copy)
@@ -398,6 +398,16 @@
* @todo Log detailed errors to full file
*/
protected static function log_error_if_necessary($errno, $errstr, $errfile, $errline, $errcontext, $errtype) {
+ if(class_exists('SS_Log')) {
+ SS_Log::log(array(
<?php
/**
* Simple implementation of the SS_Log class that came in 2.4, for compatability with SilverStripe 2.3.
*/
class SS_Log {
protected static $writer;
protected static $priority_names = array(
3 => 'ERR',
Index: sapphire/conf/ConfigureFromEnv.php
===================================================================
--- sapphire/conf/ConfigureFromEnv.php (revision 91593)
+++ sapphire/conf/ConfigureFromEnv.php (working copy)
@@ -98,7 +98,7 @@
Security::setDefaultAdmin(SS_DEFAULT_ADMIN_USERNAME, SS_DEFAULT_ADMIN_PASSWORD);
}
if(defined('SS_USE_BASIC_AUTH') && SS_USE_BASIC_AUTH) {
- BasicAuth::enable();
+ BasicAuth::protect_entire_site();
if(isRecon) getReconData(updateGraph);
else getGuardianData(updateGraph);
function updateGraph(graphData) {
// only needs to be implemented once
}
function getReconData(callback) {
$.get(
success: function(data) {
=begin
Ajax Handling
This pair of methods lets us wait for ajax actions to complete before proceeding.
To use:
* Call ajax_before_action prior to the action - e.g. button/link click
* Call ajax_after_action after the action
What happens:
* If the action didn't trigger an ajax call, then it won't wait
Index: sapphire/tests/cuke/step_definitions/db-fixture.rb
===================================================================
--- sapphire/tests/cuke/step_definitions/db-fixture.rb (revision 0)
+++ sapphire/tests/cuke/step_definitions/db-fixture.rb (revision 0)
@@ -0,0 +1,3 @@
+# Reset database
+$browser.goto $baseURL + 'dev/tests/endsession'
+$browser.goto $baseURL + 'dev/tests/startsession?fixture=sapphire/tests/Bare.yml&flush=1'
Index: cms/tests/cuke/login.feature
===================================================================
diff --git a/arb b/arb
index b909d10..5699941 100755
--- a/arb
+++ b/arb
@@ -60,6 +60,10 @@ if(file_exists(".mergesources.yml")) {
echo "$dir (from $svnRoot$source)\n";
+ // Scrub source and dest of extraneous mergeinfo
+ $svn->scrubMergeInfoIfNecessary($source, true);
Index: code/ForumHolder.php
===================================================================
--- code/ForumHolder.php (revision 97040)
+++ code/ForumHolder.php (working copy)
@@ -371,25 +371,25 @@
* @return array Returns an array to render the search results.
*/
function search() {
- $XML_keywords = Convert::raw2xml((isset($_REQUEST['Search'])) ? $_REQUEST['Search'] : null);
- $ATT_keywords = Convert::raw2att((isset($_REQUEST['Search'])) ? $_REQUEST['Search'] : null);
Index: sphinx/code/SphinxVariants.php
===================================================================
--- sphinx/code/SphinxVariants.php (revision 97051)
+++ sphinx/code/SphinxVariants.php (working copy)
@@ -61,11 +61,22 @@
static function alterSearch(&$indexes, &$search) {
foreach (self::variant_handlers() as $variantclass) singleton($variantclass)->alterSearch($indexes, $search);
}
+
+ /**