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. 2
      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', 'setting',
'Plugins', 'Plugins',
$pluginName, $pluginName,
null, '',
null, '',
null, '',
$_configuration['access_url'], $_configuration['access_url'],
1 1
); );

@ -603,7 +603,6 @@ function storeRegions()
// Get a list of all current 'Plugins' settings // Get a list of all current 'Plugins' settings
$installed_plugins = $plugin_obj->get_installed_plugins(); $installed_plugins = $plugin_obj->get_installed_plugins();
$shortlist_installed = array(); $shortlist_installed = array();
if (!empty($installed_plugins)) { if (!empty($installed_plugins)) {
foreach ($installed_plugins as $plugin) { 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(); $plugin_list = $plugin_obj->read_plugins_from_path();

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

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

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

Loading…
Cancel
Save