I have a big database and do a selection by filter and then ,select all, and click Export.
For a ālimitedā number I get a download āAccounts.csvā and if I select a bigger number I get an error.
Where is the LIMIT in size or number ??
Thanks
William
Even after changing the 1000 upto 50000 it is still giving the same error.
I have changed the settings in apps\suitecrm\htdocs\config.php
āresource_managementā =>
array (
āspecial_query_limitā => 50000,
āspecial_query_modulesā =>
array (
0 => āReportsā,
1 => āExportā,
2 => āImportā,
3 => āAdministrationā,
4 => āSyncā,
),
ādefault_limitā => 1000, (changed this to 50000)
),
1 Like
You can try debugging the code to understand what it does.
The portion of code that verifies the config values can be found in include/resource/ResourceManager.php
//Load config
if(!empty($observer->module)) {
$limit = 0;
if(isset($GLOBALS['sugar_config']['resource_management'])) {
$res = $GLOBALS['sugar_config']['resource_management'];
if(!empty($res['special_query_modules']) &&
in_array($observer->module, $res['special_query_modules']) &&
!empty($res['special_query_limit']) &&
is_int($res['special_query_limit']) &&
$res['special_query_limit'] > 0) {
$limit = $res['special_query_limit'];
} else if(!empty($res['default_limit']) && is_int($res['default_limit']) && $res['default_limit'] > 0) {
$limit = $res['default_limit'];
}
} //if
if($limit) {
$db = DBManagerFactory::getInstance();
$db->setQueryLimit($limit);
$observer->setLimit($limit);
$this->_observers[] = $observer;
}
return true;
}
After this you can check DBManagerFactory to see if the limit is actually used or observer.
Unfortunately I donāt think it is an easy task and, personally I cannot be of further help because I donāt know the internals of this part of code.
Just to try more I went and looked at include/database/DBManager.php
Ther is a function:
/**
* This function sets the query threshold limit
*
* @param int $limit value of query threshold limit
*/
public static function setQueryLimit($limit)
{
//reset the queryCount
self::$queryCount = 0;
self::$queryLimit = $limit;
}
This function sets a variable called $query_limit whose default is 0.
Unfortunately I canāt find whre it is used.
Have you considered getting the export directly from the database (using phpMyAdmin or similar)?
If itās a lot of data, it can be easier, and you might get additional control on your queries, cross-link several tables, etc.
One more thing: maybe the error that you get is not due to the limit in the query but in a low setting of max_execution_time in php.ini