This trivial snippet was working with CGGoogleMaps module to display dynamically a list of users on a map, if they have completed the field "adresse" (sorry I'm french) in their profile :
Code: Select all
{* let's grab the values *}
{foreach from=$users item='oneuser'}
{foreach from=$oneuser.properties item='onepropvalue' key='propname'}
{cggm_add_dynpoint map='1' address="$onepropvalue" name="$oneuser.username"}
{/foreach}
{/foreach}
{* let's display the map *}
{CGGoogleMaps map="1"}
After some primary investigations, it seems that CGUserDirectory has changed somethings with his variables. If we open the class.cggm_marker.php on line 21 we'll find :Fatal error: Uncaught exception 'Exception' with message 'Invalid parameters passed to cggm_marker constructor' in /homez.383/sfpapa/www/cms/modules/CGGoogleMaps/lib/class.cggm_marker.php:21 Stack trace: #0 /homez.383/sfpapa/www/cms/modules/CGGoogleMaps/CGGoogleMaps.module.php(163): cggm_marker->__construct('Array.username', '', '', '', '') #1 /homez.383/sfpapa/www/cms/tmp/templates_c/CGUserDirectory^%%D1^D14^D141B3DD%%module_db_tpl%3ACGUserDirectory%3Bsummary_maps2.php(12): cggm_add_dynpoint(Array, Object(Smarty_CMS)) #2 /homez.383/sfpapa/www/cms/lib/smarty/Smarty.class.php(1283): include('/homez.383/sfpa...') #3 /homez.383/sfpapa/www/cms/lib/classes/module_support/modtemplates.inc.php(242): Smarty->fetch('module_db_tpl:C...', '', 'CGUserDirectory') #4 /homez.383/sfpapa/www/cms/lib/classes/class.module.inc.php(2861): cms_module_ProcessTemplateFromDatabase(Object(CGUserDirectory), 'summary_maps2', '', false, '') #5 /homez.383/sfpapa/www/cms/modules/CGUserDirectory/action.default.php(507): CMSModule->ProcessTemplateFromDat in /homez.383/sfpapa/www/cms/modules/CGGoogleMaps/lib/class.cggm_marker.php on line 21
Code: Select all
public function __construct($title,$address = '',$lat = '',$long = '',$icon = '')
{
if( $title == '' || ($address == '' && ($lat == '' || $long == '' )) )
{
throw new Exception('Invalid parameters passed to cggm_marker constructor');
}
$this->_title = $title;
$this->_address = $address;
$this->_lat = $lat;
$this->_long = $long;
$this->_icon = $icon; // should look this up somehow.
}
I think the key is around here, but can't find it.
Any ideas ?