diff --git a/modules/formulize/class/forms.php b/modules/formulize/class/forms.php index 9ccdbf5ac..6269bfe32 100755 --- a/modules/formulize/class/forms.php +++ b/modules/formulize/class/forms.php @@ -1255,11 +1255,11 @@ function getPerGroupFilterWhereClause($fid, $formAlias="", $groupids=false) { $filterOOM = array(); for($i=0;$iget($filterSettings[0][$i])) { + if(!isMetaDataField($filterSettings[0][$i]) AND $elementObject = $element_handler->get($filterSettings[0][$i])) { $filterSettings[0][$i] = $elementObject->getVar('ele_handle'); } else { print "Formulize Error: a per-group permission filter on form $fid is referencing an element that does not exist. Was it renamed or deleted?
"; - return ""; + exit(); // can't invoke intended per-group permissions, must fail out rather than risk showing data user should not have access to :( } if($filterSettings[3][$i] == "all") { $filterAll[] = $i; diff --git a/modules/formulize/include/elementdisplay.php b/modules/formulize/include/elementdisplay.php index 38b4f1318..c5d8001f8 100644 --- a/modules/formulize/include/elementdisplay.php +++ b/modules/formulize/include/elementdisplay.php @@ -459,21 +459,23 @@ function buildEvaluationCondition($match,$indexes,$filterElements,$filterOps,$fi $element_handler = xoops_getmodulehandler('elements', 'formulize'); foreach ($filterElements as $key => $element) { - // make sure that the filterElements array is using handles, as originally designed and required by code below - if($filterElementObject = $element_handler->get($element)) { - $filterElements[$key] = $filterElementObject->getVar('ele_handle'); - } else { - print "Formulize Error: a display or disabled condition for a form element, is referencing a non existent element in another form. Probably the element was deleted?
"; - return false; - } - $element_metadata = formulize_getElementMetaData($element, !is_numeric($element)); - if($element_metadata['ele_uitextshow'] AND isset($element_metadata['ele_uitext'])) { - $filterTerms[$key] = formulize_swapUIText($filterTerms[$key], unserialize($element_metadata['ele_uitext'])); + if(!isMetaDataField($element)) { + // make sure that the filterElements array is using handles, as originally designed and required by code below + if($filterElementObject = $element_handler->get($element)) { + $filterElements[$key] = $filterElementObject->getVar('ele_handle'); + } else { + print "Formulize Error: a display or disabled condition for a form element, is referencing a non existent element in another form. Probably the element was deleted?
"; + return false; + } + $element_metadata = formulize_getElementMetaData($element, !is_numeric($element)); + if($element_metadata['ele_uitextshow'] AND isset($element_metadata['ele_uitext'])) { + $filterTerms[$key] = formulize_swapUIText($filterTerms[$key], unserialize($element_metadata['ele_uitext'])); + } + if($element_metadata['ele_type'] == 'yn' AND ($filterTerms[$key] == 'Yes' OR $filterTerms[$key] == 'No') AND $xoopsConfig['language'] == 'french') { + $filterTerms[$key] = $filterTerms[$key] == 'Yes' ? 'Oui' : $filterTerms[$key]; + $filterTerms[$key] = $filterTerms[$key] == 'No' ? 'Non' : $filterTerms[$key]; + } } - if($element_metadata['ele_type'] == 'yn' AND ($filterTerms[$key] == 'Yes' OR $filterTerms[$key] == 'No') AND $xoopsConfig['language'] == 'french') { - $filterTerms[$key] = $filterTerms[$key] == 'Yes' ? 'Oui' : $filterTerms[$key]; - $filterTerms[$key] = $filterTerms[$key] == 'No' ? 'Non' : $filterTerms[$key]; - } }