Skip to content

Commit e63b2c5

Browse files
committed
Learnpath: #fix leanrpath edicion and configuration not accessible when in a session on the lp user subscripcion page - refs BT#22959
1 parent 27d9121 commit e63b2c5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

main/lp/learnpath.class.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6940,7 +6940,8 @@ public function build_action_menu(
69406940
$isConfigPage = false,
69416941
$allowExpand = true,
69426942
$action = '',
6943-
$extraField = []
6943+
$extraField = [],
6944+
$noEdition = false
69446945
) {
69456946
$actionsRight = '';
69466947
$lpId = $this->lp_id;
@@ -6997,7 +6998,7 @@ public function build_action_menu(
69976998

69986999
$subscriptionSettings = self::getSubscriptionSettings();
69997000
$request = api_request_uri();
7000-
if (strpos($request, 'edit') === false) {
7001+
if ((strpos($request, 'edit') === false) && !$noEdition) {
70017002
$actionsLeft .= Display::url(
70027003
Display::return_icon(
70037004
'settings.png',
@@ -7012,7 +7013,7 @@ public function build_action_menu(
70127013
);
70137014
}
70147015

7015-
if ((strpos($request, 'build') === false &&
7016+
if ((strpos($request, 'build') === false && !$noEdition &&
70167017
strpos($request, 'add_item') === false) ||
70177018
in_array($action, ['add_audio'])
70187019
) {

main/lp/lp_subscribe_users.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,12 @@
370370
$items[] = $formUserGroup->toHtml();
371371
}
372372

373-
$menu = $oLP->build_action_menu(true, false, true, false);
373+
$noEdition = false;
374+
if (!isset($sessionId) || $sessionId !== 0) {
375+
$noEdition = true;
376+
}
377+
378+
$menu = $oLP->build_action_menu(true, false, true, false, '', [], $noEdition);
374379

375380
$tpl = new Template();
376381
$tabs = Display::tabs($headers, $items);

0 commit comments

Comments
 (0)