Skip to content

Commit

Permalink
Check that a section has fields first, fixes #406
Browse files Browse the repository at this point in the history
  • Loading branch information
brendo committed Sep 25, 2010
1 parent 80c0153 commit 7c37dc0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
15 changes: 10 additions & 5 deletions symphony/content/content.blueprintsevents.php
Expand Up @@ -320,11 +320,16 @@ function __formAction(){

$sectionManager = new SectionManager($this->_Parent);
$section = $sectionManager->fetch($fields['source']);
$markup = NULL;
foreach($section->fetchFields() as $f){
if ($f->getExampleFormMarkup() instanceof XMLElement)
$container->appendChild($f->getExampleFormMarkup());

$section_fields = $section->fetchFields();
if(is_array($section_fields) && !empty($section_fields)) {
foreach($section_fields as $f) {
if ($f->getExampleFormMarkup() instanceof XMLElement) {
$container->appendChild($f->getExampleFormMarkup());
}
}
}

$container->appendChild(Widget::Input('action['.$rootelement.']', __('Submit'), 'submit'));

$code = $container->generate(true);
Expand Down Expand Up @@ -442,4 +447,4 @@ function __injectAboutInformation(&$shell, $details){
}
}

?>
?>
13 changes: 4 additions & 9 deletions symphony/lib/toolkit/class.eventmanager.php
Expand Up @@ -85,14 +85,10 @@ function listAll(){
$f = $f = self::__getHandleFromFilename($f);

if($about = $this->about($f)){

$classname = $this->__getClassName($f);

$can_parse = false;
$type = NULL;

$about['can_parse'] = $can_parse;
$result[$f] = $about;

$about['can_parse'] = false;
$result[$f] = $about;
}
}
}
Expand All @@ -119,7 +115,6 @@ function &create($name, $environment=NULL){

return new $classname($this->_Parent, $environment);

}
}

}

0 comments on commit 7c37dc0

Please sign in to comment.