|
From: <gem...@li...> - 2013-03-14 08:42:57
|
Revision: 1178
http://sourceforge.net/p/gemstracker/code/1178
Author: mennodekker
Date: 2013-03-14 08:42:54 +0000 (Thu, 14 Mar 2013)
Log Message:
-----------
Hidden elements should go into the subform so they are available for validation
Modified Paths:
--------------
trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php
trunk/library/classes/Gems/TabForm.php
trunk/library/classes/MUtil/Validate/Db/UniqueValue.php
Modified: trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php
===================================================================
--- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-13 16:12:06 UTC (rev 1177)
+++ trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-14 08:42:54 UTC (rev 1178)
@@ -153,8 +153,12 @@
$form->addElement($element);
$element->removeDecorator('HtmlTag');
$element->removeDecorator('Label');
- $form->addDisplayGroup(array('formLinks'), 'form_buttons');
- $form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->removeElement($element->getName());
+
+ if (is_null($form->getDisplayGroup(Gems_TabForm::GROUP_OTHER))) {
+ $form->addDisplayGroup(array($element), Gems_TabForm::GROUP_OTHER);
+ } else {
+ $form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->addElement($element);
+ }
}
}
Modified: trunk/library/classes/Gems/TabForm.php
===================================================================
--- trunk/library/classes/Gems/TabForm.php 2013-03-13 16:12:06 UTC (rev 1177)
+++ trunk/library/classes/Gems/TabForm.php 2013-03-14 08:42:54 UTC (rev 1178)
@@ -102,27 +102,13 @@
*/
public function addElement($element, $name = null, $options = null)
{
- if ($element instanceof Zend_Form_Element_Hidden) {
- parent::addElement($element, $name, $options);
-
- //Remove decorators
- $element->removeDecorator('HtmlTag');
- $element->removeDecorator('Label');
-
- $this->addToOtherGroup($element);
-
- $element->removeDecorator('DtDdWrapper');
-
- return $this;
- }
-
if ($this->currentTab) {
return $this->currentTab->addElement($element, $name, $options);
} else {
parent::addElement($element, $name, $options);
if (is_string($element)) {
- $element = $this->getElement($element);
+ $element = $this->getElement($name);
}
$this->addToOtherGroup($element);
Modified: trunk/library/classes/MUtil/Validate/Db/UniqueValue.php
===================================================================
--- trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-13 16:12:06 UTC (rev 1177)
+++ trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-14 08:42:54 UTC (rev 1178)
@@ -108,8 +108,7 @@
public function isValid($value, $context = array())
{
- // Quick fix for context not being complete in subform
- $context = $context + $_POST;
+ $context = $context;
/**
* Check for an adapter being defined. if not, fetch the default adapter.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|