FIX socialnetworks API if module not active
This commit is contained in:
parent
34beca0758
commit
a641c81d92
@ -1095,7 +1095,11 @@ class Setup extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function getListOfsocialNetworks($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
public function getListOfsocialNetworks($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
$list = array();
|
if (empty($conf->global->MAIN_MODULE_SOCIALNETWORKS)) {
|
||||||
|
throw new RestException(400, 'API not available: this dictionary is not enabled by setup');
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = array();
|
||||||
//TODO link with multicurrency module
|
//TODO link with multicurrency module
|
||||||
$sql = "SELECT t.rowid, t.entity, t.code, t.label, t.url, t.icon, t.active";
|
$sql = "SELECT t.rowid, t.entity, t.code, t.label, t.url, t.icon, t.active";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_socialnetworks as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_socialnetworks as t";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user