Merge pull request #53 from spekulatius/fixing-remaining-MultiSessionID-to-get_var

BUGFIX: remove last MultiFormSessionID
This commit is contained in:
Damian Mooyman 2015-12-02 10:43:20 +13:00
commit 47763d9ed8
3 changed files with 14 additions and 5 deletions

View File

@ -32,18 +32,18 @@ class MultiFormObjectDecorator extends DataExtension {
$where = $query->getWhere();
if(!$where && !$this->wantsTemporary($query)) {
$from = array_values($query->getFrom());
$query->addWhere("{$from[0]}.MultiFormIsTemporary = 0");
$query->addWhere("{$from[0]}.\"MultiFormIsTemporary\" = '0'");
return;
}
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
&& !$this->wantsTemporary($query)
) {
$from = array_values($query->getFrom());
$query->addWhere("{$from[0]}.MultiFormIsTemporary = 0");
$query->addWhere("{$from[0]}.\"MultiFormIsTemporary\" = '0'");
}
}

View File

@ -175,6 +175,15 @@ abstract class MultiForm extends Form {
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.
*

View File

@ -1,7 +1,7 @@
<ul class="stepIndicator current-$CurrentStep.class">
<% loop AllStepsLinear %>
<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}&amp;StepID={$ID}"><% end_if %><% end_if %>
<% if LinkingMode = current %><% else %><% if ID %><a href="{$Top.URLSegment}/?${Top.GetVar}={$SessionID}&amp;StepID={$ID}"><% end_if %><% end_if %>
<% if Title %>$Title<% else %>$ClassName<% end_if %>
<% if LinkingMode = current %><% else %><% if ID %></a><% end_if %><% end_if %>
</li>