Replace null with '' string see BT#13024

pull/2487/head
jmontoyaa 8 years ago
parent 5b2a3c8b66
commit b645a34fdc
  1. 6
      main/admin/configure_plugin.php
  2. 4
      main/admin/settings.lib.php
  3. 19
      main/inc/lib/api.lib.php
  4. 1
      main/inc/lib/plugin.class.php
  5. 15
      main/inc/lib/plugin.lib.php

@ -72,9 +72,9 @@ if (isset($form)) {
'setting',
'Plugins',
$pluginName,
null,
null,
null,
'',
'',
'',
$_configuration['access_url'],
1
);

@ -603,7 +603,6 @@ function storeRegions()
// Get a list of all current 'Plugins' settings
$installed_plugins = $plugin_obj->get_installed_plugins();
$shortlist_installed = array();
if (!empty($installed_plugins)) {
foreach ($installed_plugins as $plugin) {
@ -612,7 +611,6 @@ function storeRegions()
}
}
}
$shortlist_installed = array_flip(array_flip($shortlist_installed));
$plugin_list = $plugin_obj->read_plugins_from_path();
@ -1810,4 +1808,4 @@ function getCategorySettings($category = '')
'settings' => $settings,
'settings_by_access_list' => $settings_by_access_list
);
}
}

@ -5334,25 +5334,24 @@ function &api_get_settings($cat = null, $ordering = 'list', $access_url = 1, $ur
* @param string $scope The scope
* @param string $subKeyText The subkey text
* @param int $accessUrlId The access_url for which this parameter is valid
* @param int $visiblity The changeability of this setting for non-master urls
* @param int $visibility The changeability of this setting for non-master urls
* @return int The setting ID
*/
function api_add_setting(
$value,
$variable,
$subKey = null,
$subKey = '',
$type = 'textfield',
$category = null,
$title = null,
$comment = null,
$scope = null,
$subKeyText = null,
$category = '',
$title = '',
$comment = '',
$scope = '',
$subKeyText = '',
$accessUrlId = 1,
$visiblity = 0
$visibility = 0
) {
$em = Database::getManager();
$settingRepo = $em->getRepository('ChamiloCoreBundle:SettingsCurrent');
$accessUrlId = (int) $accessUrlId ?: 1;
$criteria = ['variable' => $variable, 'accessUrl' => $accessUrlId];
@ -5388,7 +5387,7 @@ function api_add_setting(
->setScope($scope)
->setSubkeytext($subKeyText)
->setAccessUrl($accessUrlId)
->setAccessUrlChangeable($visiblity);
->setAccessUrlChangeable($visibility);
$em->persist($setting);
$em->flush();

@ -791,6 +791,7 @@ class Plugin
$langString = str_replace('Plugin', '', get_class($this));
$pluginName = strtolower($langString);
$pluginUrl = 'plugin/'.$pluginName.'/'.$filePath;
if ($showTab === 'true') {
$tabAdded = $this->addTab($langString, $pluginUrl);
if ($tabAdded) {

@ -158,9 +158,9 @@ class AppPlugin
'setting',
'Plugins',
$pluginName,
null,
null,
null,
'',
'',
'',
$urlId,
1
);
@ -479,7 +479,6 @@ class AppPlugin
*/
public function add_to_region($plugin, $region)
{
$access_url_id = api_get_current_access_url_id();
api_add_setting(
$plugin,
$region,
@ -487,10 +486,10 @@ class AppPlugin
'region',
'Plugins',
$plugin,
null,
null,
null,
$access_url_id,
'',
'',
'',
api_get_current_access_url_id(),
1
);
}

Loading…
Cancel
Save