Skip to content

Commit

Permalink
fix #736 empty date country
Browse files Browse the repository at this point in the history
  • Loading branch information
ximex committed Apr 15, 2018
1 parent b34b9f5 commit 62bf88f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions adm_program/modules/dates/dates.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
// Create Google-Maps-Link for location
$location_url = 'https://maps.google.com/?q='.$date->getValue('dat_location');

if($date->getValue('dat_country') !== '')
if($date->getValue('dat_country'))
{
// Better results with additional country information
$location_url .= ',%20'.$date->getValue('dat_country');
Expand Down Expand Up @@ -390,7 +390,7 @@

$route_url .= '&daddr='.urlencode($date->getValue('dat_location'));

if($date->getValue('dat_country') !== '')
if($date->getValue('dat_country'))
{
// With information about country Google finds the location much better
$route_url .= ',%20'.$date->getValue('dat_country');
Expand Down Expand Up @@ -788,8 +788,8 @@
if(is_array($participantsArray))
{
// Only show participants if user has right to view the list, is leader or has permission to create/edit events
if ($gCurrentUser->hasRightViewRole($date->getValue('dat_rol_id'))
|| $row['mem_leader'] == 1
if ($gCurrentUser->hasRightViewRole($date->getValue('dat_rol_id'))
|| $row['mem_leader'] == 1
|| $gCurrentUser->editDates())
{
foreach($participantsArray as $participant)
Expand Down
2 changes: 1 addition & 1 deletion adm_program/modules/dates/dates_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
// das Land nur zusammen mit dem Ort abspeichern
if(strlen($_POST['dat_location']) === 0)
{
$_POST['dat_country'] = '';
$_POST['dat_country'] = null;
}

// ------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion adm_program/modules/dates/dates_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function setLocationCountry() {
{
$form->addInput('dat_location', $gL10n->get('DAT_LOCATION'), $date->getValue('dat_location'), array('maxLength' => 100, 'helpTextIdLabel' => 'DAT_LOCATION_LINK'));

if(strlen($date->getValue('dat_country')) === 0 && $getDateId === 0)
if(!$date->getValue('dat_country') && $getDateId === 0)
{
$date->setValue('dat_country', $gPreferences['default_country']);
}
Expand Down
2 changes: 1 addition & 1 deletion adm_program/system/classes/tabledate.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function getValue($columnName, $format = '')

if ($format !== 'database')
{
if ($columnName === 'dat_country' && $value !== '')
if ($columnName === 'dat_country' && $value)
{
// beim Land die sprachabhaengige Bezeichnung auslesen
$value = $gL10n->getCountryByCode($value);
Expand Down

0 comments on commit 62bf88f

Please sign in to comment.