Skip to content

Commit

Permalink
Learnpath: Fix order menu tree when it has final item - refs BT#20362
Browse files Browse the repository at this point in the history
  • Loading branch information
cfasanando committed Jan 31, 2023
1 parent 9635771 commit e750540
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion main/lp/learnpath.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6775,6 +6775,9 @@ public function print_recursive($elements, $default_data, $default_content)
{
$return = '';
foreach ($elements as $key => $item) {
if (TOOL_LP_FINAL_ITEM === $item['type']) {
$key = 'final_item';
}
if (isset($item['load_data']) || empty($item['data'])) {
$item['data'] = $default_data[$item['load_data']];
$item['type'] = $default_content[$item['load_data']]['item_type'];
Expand Down Expand Up @@ -13507,7 +13510,7 @@ public function getFinalItemForm()
);
$form->addHtml(
Display::return_message(
get_lang('LPEndStepAddTagsToShowCertificateOrSkillAutomatically') . '</br></br> <b>((certificate))</b> </br> <b>((skill))</b>',
get_lang('LPEndStepAddTagsToShowCertificateOrSkillAutomatically').'</br></br> <b>((certificate))</b> </br> <b>((skill))</b>',
'normal',
false
)
Expand Down
2 changes: 1 addition & 1 deletion main/lp/lp_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function get_UL_integer_id(in_ul_id) {
$(".li_container .order_items").click(function(e) {
var dir = $(this).data("dir");
var itemId = $(this).data("id");
var jItems = $("#lp_item_list li.li_container");
var jItems = $("#lp_item_list li.li_container:not(#final_item)");
var jItem = $("#"+ itemId);
var index = jItems.index(jItem);
var total = jItems.length;
Expand Down

0 comments on commit e750540

Please sign in to comment.