mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX Fixed SQL that contained backticks to work on databases with ANSI SQL enabled
This commit is contained in:
parent
16307e5562
commit
4cdeb3d20f
@ -110,7 +110,11 @@ class UserDefinedForm extends Page {
|
||||
*/
|
||||
public function doPublish() {
|
||||
// remove fields on the live table which could have been orphaned.
|
||||
$live = Versioned::get_by_stage("EditableFormField", "Live", "`EditableFormField`.ParentID = $this->ID");
|
||||
if(defined('Database::USE_ANSI_SQL')) {
|
||||
$live = Versioned::get_by_stage("EditableFormField", "Live", "\"EditableFormField\".\"ParentID\" = $this->ID");
|
||||
} else {
|
||||
$live = Versioned::get_by_stage("EditableFormField", "Live", "`EditableFormField`.ParentID = $this->ID");
|
||||
}
|
||||
if($live) {
|
||||
foreach($live as $field) {
|
||||
$field->deleteFromStage('Live');
|
||||
|
@ -31,7 +31,11 @@ class EditableMultipleOptionField extends EditableFormField {
|
||||
* @return void
|
||||
*/
|
||||
public function publish($fromStage, $toStage, $createNewVersion = false) {
|
||||
$live = Versioned::get_by_stage("EditableOption", "Live", "`EditableOption`.ParentID = $this->ID");
|
||||
if(defined('Database::USE_ANSI_SQL')) {
|
||||
$live = Versioned::get_by_stage("EditableOption", "Live", "\"EditableOption\".\"ParentID\" = $this->ID");
|
||||
} else {
|
||||
$live = Versioned::get_by_stage("EditableOption", "Live", "`EditableOption`.ParentID = $this->ID");
|
||||
}
|
||||
if($live) {
|
||||
foreach($live as $option) {
|
||||
$option->delete();
|
||||
|
Loading…
Reference in New Issue
Block a user