aniesshsethh / GoogleAutocomplete

This plugin will provide google autocomplete functionality to accounts, leads and contacts module of SugarCRM when filling in address.
http://www.aniesshsethh.com
6 stars 4 forks source link

SuiteCRM 7.7.5 #5

Open chris001 opened 8 years ago

chris001 commented 8 years ago

Installed your module on SuiteCRM 7.7.5 ( https://www.github.com/salesagility/SuiteCRM ), which is SugarCRM 6.5.29 plus many enhanced and extra modules, equivalent to Sugar Pro.

And the module crashes with blank screen area, on the create or edit screens, for Lead, Contact, and Account. See below. Possibly jquery conflict?

image

Could you have a closer look at this?

chris001 commented 7 years ago

I received verification of this bug @aniesshsethh from SuiteCRM support @ijdavie on this issue https://github.com/salesagility/SuiteCRM/issues/2360 :

@chris001, When we test the SuiteCRM leads module without this plugin install no errors appear in the console, however after it is installed the error,

js?v=3.exp&sensor=false&libraries=places&callback=initialize&_=1476697783340:37 Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error

It appears that the autocomplete plugin uses the Maps Javascript API which requires a key to work.

https://developers.google.com/maps/documentation/javascript/places-autocomplete

Loading the library

The Places service is a self-contained library, separate from the main Maps JavaScript API code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>

chris001 commented 7 years ago

I found the bug, the Google AutoComplete module adds a line of PHP code to custom/modules/Leads/metadata/editviewdefs.php incorrectly, causing a PHP parsing error, the page crashed with the white area.

PHP Parse error:  syntax error, unexpected '<' in /home/user/public_html/crm/custom/modules/Leads/metadata/editviewdefs.php on line 189

The code was added:

<?php $viewdefs["Leads"]["EditView"]["templateMeta"]["includes"][]["file"] = "custom/modules/Leads/js/contact_lead_autocomplete.js";?>

It should be:

$viewdefs["Leads"]["EditView"]["templateMeta"]["includes"][]["file"] = "custom/modules/Leads/js/contact_lead_autocomplete.js";

because the editviewdefs.php file already has the PHP start tag <?php active

chris001 commented 7 years ago

I made pull request #6 to fix this bug.

aniesshsethh commented 7 years ago

As mentioned in pull request #7 , I do not see the PHP tags causing any kind of issue as they append after the end of the editviewdefs file. So unless the file didn't had the closing PHP tags, I do not see how it could have caused any kind of issue. Please let me know.

chris001 commented 7 years ago

Yes the file didn't have the closing PHP tag. I'll attach my screenshot and copy of editviewdefs.php on #7 for you to compare, to your screenshot.

holdusback commented 5 years ago

Excuse me to reply to thus old post but is this working on the latest suitecrm version ? (7.11.1)

I want a free autocomplete module but idk if this one is still working...