Commit 99e5122f authored by Nigel McNie's avatar Nigel McNie Committed by Penny Leach
Browse files

Fixed an old bug where going back to step three then forward to step for when...

Fixed an old bug where going back to step three then forward to step for when creating a view would cause a bogus ACL entry to appear.
parent ba719aa6
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
* @return string The HTML for the element * @return string The HTML for the element
*/ */
function pieform_element_viewacl(Pieform $form, $element) { function pieform_element_viewacl(Pieform $form, $element) {
// @todo addressbook stuff...
$smarty = smarty(); $smarty = smarty();
$smarty->left_delimiter = '{{'; $smarty->left_delimiter = '{{';
$smarty->right_delimiter = '}}'; $smarty->right_delimiter = '}}';
...@@ -42,13 +41,18 @@ function pieform_element_viewacl(Pieform $form, $element) { ...@@ -42,13 +41,18 @@ function pieform_element_viewacl(Pieform $form, $element) {
// Look for the presets and split them into two groups // Look for the presets and split them into two groups
$presets = array('public', 'loggedin', 'friends'); $presets = array('public', 'loggedin', 'friends');
if ($value) { if ($value) {
foreach ($value as &$item) { foreach ($value as $key => &$item) {
if (in_array($item['type'], $presets)) { if (is_array($item)) {
$item['name'] = get_string($item['type']); if (in_array($item['type'], $presets)) {
$item['preset'] = true; $item['name'] = get_string($item['type']);
$item['preset'] = true;
}
else {
$item['name'] = pieform_render_viewacl_getvaluebytype($item['type'], $item['id']);
}
} }
else { else {
$item['name'] = pieform_render_viewacl_getvaluebytype($item['type'], $item['id']); unset($value[$key]);
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment