Skip to content

Commit

Permalink
Dev: Fixed issue : bad value for default answer in map question broke…
Browse files Browse the repository at this point in the history
… with debug

Dev: test if ; is in current value
Dev: related issue #14396: Map question with default position/answer very confusing
  • Loading branch information
Shnoulle authored and olleharstedt committed Jan 8, 2019
1 parent d4f74f8 commit 5159b3e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions application/helpers/qanda_helper.php
Expand Up @@ -2611,17 +2611,16 @@ function do_shortfreetext($ia)
$coreClass = "ls-answers map-item geoloc-item";
$currentLocation = $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]];
$currentLatLong = null;

// Get the latitude/longtitude for the point that needs to be displayed by default
if (strlen($currentLocation) > 2) {
if (strlen($currentLocation) > 2 && strpos(";",$currentLocation)) { // Quick check if current location is OK
$currentLatLong = explode(';', $currentLocation);
$currentLatLong = array($currentLatLong[0], $currentLatLong[1]);
} else {
if ((int) ($aQuestionAttributes['location_nodefaultfromip']) == 0) {
$currentLatLong = getLatLongFromIp(getIPAddress());
}

if (!isset($currentLatLong) || $currentLatLong == false) {
if (empty($currentLatLong)) {
$floatLat = 0;
$floatLng = 0;
$sDefaultcoordinates=trim(LimeExpressionManager::ProcessString($aQuestionAttributes['location_defaultcoordinates'], $ia[0], array(), 3, 1, false, false, true));/* static var is the last one */
Expand Down

0 comments on commit 5159b3e

Please sign in to comment.