mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-09-30 12:38:58 +02:00
Merge pull request #53 from spekulatius/fixing-remaining-MultiSessionID-to-get_var
BUGFIX: remove last MultiFormSessionID
This commit is contained in:
commit
47763d9ed8
@ -32,18 +32,18 @@ class MultiFormObjectDecorator extends DataExtension {
|
|||||||
$where = $query->getWhere();
|
$where = $query->getWhere();
|
||||||
if(!$where && !$this->wantsTemporary($query)) {
|
if(!$where && !$this->wantsTemporary($query)) {
|
||||||
$from = array_values($query->getFrom());
|
$from = array_values($query->getFrom());
|
||||||
$query->addWhere("{$from[0]}.MultiFormIsTemporary = 0");
|
$query->addWhere("{$from[0]}.\"MultiFormIsTemporary\" = '0'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(
|
if(
|
||||||
strpos($where[0], ".`ID` = ") === false
|
strpos($where[0], ".`ID` = ") === false
|
||||||
&& strpos($where[0], ".ID = ") === false
|
&& strpos($where[0], ".ID = ") === false
|
||||||
&& strpos($where[0], "ID = ") !== 0
|
&& strpos($where[0], "ID = ") !== 0
|
||||||
&& !$this->wantsTemporary($query)
|
&& !$this->wantsTemporary($query)
|
||||||
) {
|
) {
|
||||||
$from = array_values($query->getFrom());
|
$from = array_values($query->getFrom());
|
||||||
$query->addWhere("{$from[0]}.MultiFormIsTemporary = 0");
|
$query->addWhere("{$from[0]}.\"MultiFormIsTemporary\" = '0'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,6 +175,15 @@ abstract class MultiForm extends Form {
|
|||||||
return $this->controller;
|
return $this->controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the get_var to the template engine
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getGetVar() {
|
||||||
|
return $this->config()->get_var;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current step.
|
* Get the current step.
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<ul class="stepIndicator current-$CurrentStep.class">
|
<ul class="stepIndicator current-$CurrentStep.class">
|
||||||
<% loop AllStepsLinear %>
|
<% loop AllStepsLinear %>
|
||||||
<li class="$ClassName<% if LinkingMode %> $LinkingMode<% end_if %><% if FirstLast %> $FirstLast<% end_if %><% if $ExtraClasses %> $ExtraClasses<% end_if %>">
|
<li class="$ClassName<% if LinkingMode %> $LinkingMode<% end_if %><% if FirstLast %> $FirstLast<% end_if %><% if $ExtraClasses %> $ExtraClasses<% end_if %>">
|
||||||
<% if LinkingMode = current %><% else %><% if ID %><a href="{$Top.URLSegment}/?MultiFormSessionID={$SessionID}&StepID={$ID}"><% end_if %><% end_if %>
|
<% if LinkingMode = current %><% else %><% if ID %><a href="{$Top.URLSegment}/?${Top.GetVar}={$SessionID}&StepID={$ID}"><% end_if %><% end_if %>
|
||||||
<% if Title %>$Title<% else %>$ClassName<% end_if %>
|
<% if Title %>$Title<% else %>$ClassName<% end_if %>
|
||||||
<% if LinkingMode = current %><% else %><% if ID %></a><% end_if %><% end_if %>
|
<% if LinkingMode = current %><% else %><% if ID %></a><% end_if %><% end_if %>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user