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

Revert "Fix parse error" #7

Closed aniesshsethh closed 8 years ago

aniesshsethh commented 8 years ago

Reverts aniesshsethh/GoogleAutocomplete#6

chris001 commented 8 years ago

Hi @aniesshsethh Did you look at #5 for the details on the crash which is fixed by #6

aniesshsethh commented 8 years ago

Hi @chris001 Yeah I did and almost merged it in when I realised , that can't be the issue, my stack currently is running newer PHP version which is not supported by suiteCRM. Give me sometime and I will get back on this.

chris001 commented 8 years ago

@aniesshsethh As far as I know, SuiteCRM 7 supports both PHP 5.6 and PHP 7, is this the same version as your newer PHP version which is not supported by suiteCRM ?

aniesshsethh commented 8 years ago

@chris001 this is a sugarCRM 6 plugin, I have been testing on sugarCRM ce. Getting some weird zip error when uploading the module in suiteCRM. Will need to debug. Sorry should have mentioned the php versions. I am using php 5.6, which is not supported by sugarCRM 6, I was under the impression that suiteCRM also supports what sugarCRM supports. Not in active SugarCRM development anymore :)

chris001 commented 8 years ago

@aniesshsethh The cause of the zip error is that when github makes a zip for download, it does it wrong, it creates a zip of a folder, for example, github's GoogleAutocomplete-master.zip contains a folder GoogleAutocomplete-master (totally unneeded by SuiteCRM), which contains the files and folders of this project. SuiteCRM needs the zip to only contain the files and folders, not the extra containing folder, if that makes sense. You should unzip it, go into the folder, and re-zip from the level of the files and folders, so that when you view the contents, all the files and folders are sitting visible at the top level.

aniesshsethh commented 8 years ago

@chris001 I am aware of that, which is why I had included the zip file to be uploaded in the CRM in the repo itself when I created the plugin :). This error is different .

Specified directory '' for zip file 'upload://googleautocomplete.zip' extraction does not exist.

This is the error I am getting when using XAMPP on mac.

chris001 commented 8 years ago

@aniesshsethh Here's details on how to fix that error: https://community.sugarcrm.com/thread/26170 Which version suiteCRM you using? The newest is 7.7.6.

aniesshsethh commented 8 years ago

@chris001 Na, I have tried everything there, nothing really worked. I figured the issue. It's the damn .DS_Store files that are added by the MAC which do not extract and cause the entire process to fail.

Anyways, that's not the main issue here. I installed my module as it is on SuiteCRM 7.7.6 and it worked just fine. I tested on accounts and contacts Module. The file in question editviewdefs.php was generated just fine. I really don't see the PHP tags been the issue. Please see the attached file.

screen shot 2016-10-24 at 10 01 14 pm editviewdefs.txt

chris001 commented 8 years ago

This screen shot, plus the code from custom/modules/Accounts/metadata/editviewdefs.php to which the pre_install.php added the line at the end. Due to lack of closing PHP tag ?>, the start PHP tag <?php causes a parse error and a white screen halt to PHP generating its HTML output. issue with google autocomplete module for sugarcrm editviewdefs.php.txt

And when I fix that PHP tag, the Create Account page looks much better, the form appears. But it's still got several errors.
Some of the label names are showing up instead of the actual text of the labels.
Plus, there are two non-functional buttons which are leftover from a previously installed and removed custom module, whose purpose was also to lookup addresses and phone numbers, and auto complete them, but in a less smart way that using a web service. Instead of using google, it used a saved list of previous addresses entered into the SugarCRM 6.5 system, and for phone numbers, a set format, if I recall correctly. Probably due to these above errors - odd buttons, labels and probably the javascript code that was likely left behind and not cleaned up by its uninstaller code - the Google AutoComplete module still fails to function. How to detect this type of situation and alert the user/admin that there is javascript code left behind by mistake, which is disrupting the proper functioning of the currently installed module's javascript code on the page?

aniesshsethh commented 8 years ago

ok , let's move one step at a time.

The original file from the suiteCRM as well as sugarCRM

https://github.com/salesagility/SuiteCRM/blob/master/modules/Accounts/metadata/editviewdefs.php

https://github.com/sugarcrm/sugarcrm_dev/blob/master/modules/Accounts/metadata/editviewdefs.php

Have both the starting and the ending , so whatever removed those PHP tags in your system are basically from custom coding as far as I can see. So we will not be considering that as far as the master branch of this plugin goes.

Some of the label names are showing up instead of the actual text of the labels.

Plus, there are two non-functional buttons which are leftover from a previously installed and removed custom module, whose purpose was also to lookup addresses and phone numbers, and auto complete them, but in a less smart way that using a web service. Instead of using google, it used a saved list of previous addresses entered into the SugarCRM 6.5 system, and for phone numbers, a set format, if I recall correctly. Probably due to these above errors - odd buttons, labels and probably the javascript code that was likely left behind and not cleaned up by its uninstaller code - the Google AutoComplete module still fails to function.

I understand that, but this is unrelated to the google autocomplete module. I sure can have a look over it for you. You can contact me on my skype aniessh.sethh for this.

How to detect this type of situation and alert the user/admin that there is javascript code left behind by mistake, which is disrupting the proper functioning of the currently installed module's javascript code on the page?

Just contact the author of the module ? not sure TBH

chris001 commented 8 years ago

Here's the series of odd "Add City" buttons which mess up the address layout. I'd contact the author of the module to see if he'd update it,, but since it's been uninstalled from SuiteCRM, there aren't any trace files on the system containing the name of the module or the author's name. The only remnant appears to be these "Add City" buttons and obviously the modified editviewdefs.php file. It'd be great to track down the name of the module, to find the list of files and examine the code to see how it modifies the editviewdefs.php, to see how to revert those changes. Of course that's not your problem, just had to follow up and post the rest of these details because surely someone else has run into the same bug. add city buttons mess up the address layount on create account