CGUSerDirectory and CGGoogleMaps can't display my users' map

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
square
Forum Members
Forum Members
Posts: 51
Joined: Fri Jan 15, 2010 5:02 pm

CGUSerDirectory and CGGoogleMaps can't display my users' map

Post by square »

Not sure if it's a bug but:

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"}
Now, since the update of both CgGoogleMaps and CGUserDirectory (form 1.2.4 to 1.2.6), it can't work! Instead of my map, I've got the following error message :
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
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 :

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.
  }
So, cggm_add_dynpoint doesn't understand the following variables : $title and/or $address
I think the key is around here, but can't find it.

Any ideas ?
Post Reply

Return to “Modules/Add-Ons”