Skip to content
Snippets Groups Projects
Commit b4f12503 authored by Jared Hancock's avatar Jared Hancock
Browse files

orgs: Fix error deleting organization

Also, fix clearing users in an organization when removing the organization.
parent b26b84f5
Branches
Tags
No related merge requests found
......@@ -407,9 +407,16 @@ implements TemplateVariable {
if (!parent::delete())
return false;
// Remove users from this organization
User::objects()
->filter(array('org' => $this))
->update(array('org_id' => 0));
foreach ($this->getDynamicData(false) as $entry) {
$entry->delete();
if (!$entry->delete())
return false;
}
return true;
}
static function fromVars($vars) {
......
......@@ -26,7 +26,7 @@ if ($info['error']) {
<?php foreach ($org->getDynamicData() as $entry) {
?>
<tr><td colspan="2" style="border-bottom: 1px dotted black"><strong><?php
echo $entry->getForm()->get('title'); ?></strong></td></tr>
echo $entry->getTitle(); ?></strong></td></tr>
<?php foreach ($entry->getAnswers() as $a) { ?>
<tr style="vertical-align:top"><td style="width:30%;border-bottom: 1px dotted #ccc"><?php echo Format::htmlchars($a->getField()->get('label'));
?>:</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment