Lps: Fix php error

pull/4037/head
Julio 4 years ago
parent 2863a766c5
commit 262b5e6156
  1. 12
      public/main/lp/learnpath.class.php

@ -8031,15 +8031,17 @@ class learnpath
* Get the parent names for the current item.
*
* @param int $newItemId Optional. The item ID
*
* @return array
*/
public function getCurrentItemParentNames($newItemId = 0)
public function getCurrentItemParentNames($newItemId = 0): array
{
$newItemId = $newItemId ?: $this->get_current_item_id();
$return = [];
$item = $this->getItem($newItemId);
$parent = $this->getItem($item->get_parent());
$parent = null;
if ($item) {
$parent = $this->getItem($item->get_parent());
}
while ($parent) {
$return[] = $parent->get_title();
@ -8058,7 +8060,7 @@ class learnpath
{
$subscriptionSettings = api_get_configuration_value('lp_subscription_settings');
if (empty($subscriptionSettings)) {
// By default allow both settings
// By default, allow both settings
$subscriptionSettings = [
'allow_add_users_to_lp' => true,
'allow_add_users_to_lp_category' => true,

Loading…
Cancel
Save