Closed gunnicom closed 7 years ago
Hi,
I can confirm this is also an issue on the 7.8.3. release, MYSQL 5.5 and PHP 5.6.
Thank you
I have checked on SuiteCRM demo version. But couldn't reproduce the same error. I am able to download complete list of records which were almost 50 in account module without any hassle. Also checked on SuiteCRM 7.8.2. But export functionality is working smooth.
Possibly the difference is, the online demo is using mysql 5.6, while @gunnicom is using the version of mysql which comes with ubuntu 16.04 which is mysql 5.7
The real missing ingredient to pinpoint the cause of this bug, is a proper modern error handling package....
@chris001 I could reproduce it on the demo, as you can read in my report.
@ChangezKhan : The issue is related to the Leads Module. I can also export all the of the Accounts in the Account Module.
I think the problem is, when you select all records the query to mysql has this part "WHERE ()" which I believe is incorrect syntax on all MySQL versions.
Thank you.
Ok, the problem is with only 'Leads' module then? Please correct me if I am wrong. If yes, then I think the title should be corrected.
No doubt, the Leads module search code is a copy-pasted variant of the Accounts module search code, this is why it's working differently.
Search code should be one centralized class, used by all modules, and not a copy-pasted variant of it, in every module.
I have found the error. It is in Person
class located in include\SugarObjects\templates\person\Person.php
file. On line no. 321, where it checks if $where
is not equal to blank. It is using !==
to check while in SugarCRM , it uses !=
. I don't know how to explain this but this is happening due to checking the type of $where
variable. If you remove extra =
from if condition, it works fine. In SugarCRM also, it uses only !=
while comparing $where
to blank.
Excellent find @ChangezKhan . Have you ever made a Pull Request? If you could, make a PR with your one line change in the code, and it should get merged rather quickly.
Ok, I'll. But don't you think that we need to check why there is a extra =
sign in SuiteCRM version only?
This is the commit that broke it 3 months ago: https://github.com/salesagility/SuiteCRM/commit/c328dbe50c96365cf09147260b28795c5e78e31a
Since this commit had a ton of changes, mostly syntactical and coding-convention stuff, I would say this probably was just an accident - something that looked better in a quick consideration, but had an unintended negative side-effect.
@ChangezKhan No reason for that line of code to be there. Human error, for sure.
The craziest thing is, if the automated testing tools had been activated on this github project like I've been clamoring for since quite a while, these automatic tools would have flagged the error in the code, preventing it from being released to the public with the error in it...
@ChangezKhan : Thank you. I confirm this solves the issue.
@chris001, may I know, which automated testing tools you were asking for? Any particular name, you have in mind?
@ChangezKhan My favorite free automated testing tools to add to github are:
Issue
If you go to a module and select entire list without a filter in the search, the export fails with a database error. This occurs only if you have multiple pages in your list.
The error seems to be in the SELECT at " WHERE () AND leads.deleted=0" As workaround you can filter by names and simply use "%" as filter, then it works.
Tested in Demo on suitecrm site. Error is reproducible there.
Expected Behavior
Export should work if entire list is selected.
Actual Behavior
Export does not work because of database error.
Steps to Reproduce
Your Environment