[Risolto] Bug Comando Cancellazione voce di menu in "Gestione Menu"

Funzionalità di frontend per utenti e amministratori dei corsi: navigazione generale, materiali didattici, test, registro valutazioni, ecc.
Post Reply
wolk73
FormaLms User
Posts: 46
Joined: Fri Oct 26, 2012 11:03 am
Contact:

[Risolto] Bug Comando Cancellazione voce di menu in "Gestione Menu"

Post by wolk73 »

Volevo segnalarvi un brutto bag nella "Gestione dei menu".
Alla cancellazione della voce blank screen con fatal error di PHP:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Module_Conference::getAllToken(), 0 passed in /var/www/html/forma20/appLms/admin/modules/amanmenu/amanmenu.php on line 1090 and exactly 1 expected in /var/www/html/forma20/appLms/class.module/class.conference.php:33
Stack trace:
#0 /var/www/html/forma20/appLms/admin/modules/amanmenu/amanmenu.php(1090): Module_Conference->getAllToken()
#1 /var/www/html/forma20/appLms/admin/modules/amanmenu/amanmenu.php(1134): removeModule(22, 41, '11')
#2 /var/www/html/forma20/appLms/admin/modules/amanmenu/amanmenu.php(1257): delmodule()
#3 /var/www/html/forma20/appLms/admin/class.module/class.amanmenu.php(28): manmenuDispatch('delmodule')
#4 /var/www/html/forma20/appCore/index.php(80): Module_AManmenu->loadBody()
#5 {main} thrown in /var/www/html/forma20/appLms/class.module/class.conference.php on line 33

Credo che la classe si aspetti di passare altri parametri da specifiche funzioni.
Last edited by wolk73 on Thu Mar 21, 2019 12:37 pm, edited 1 time in total.
CEO - SYCOP ITALIA
Network Internazionale di Professionisti d’alto livello Competente nel settore Web/ICT e Sicurezza UTM..
www.sycop.org
www.andreapatron.com
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: Bug Comando Cancellazione voce di menu in "Gestione Menu"

Post by alfa24 »

in appLms/admin/modules/amanmenu/amanmenu.php

sostituisci l'intera funzione removeModule con questa:

Code: Select all

function removeModule($id_module, $id_main, $id_custom) {
	
	
	$acl_man 		=& Docebo::user()->getAclManager();
	// Load module info
	$query_module = "
	SELECT module_name, default_name, file_name, class_name, default_op 
	FROM ".$GLOBALS['prefix_lms']."_module 
	WHERE idModule = '".$id_module."'";
	list($module_name, $name_db, $file_name, $class_name, $module_op) = sql_fetch_row(sql_query($query_module));
	$module_obj =& createLmsModule($module_name);
	
	$levels 			= CourseLevel::getLevels();
	$all_token 			= $module_obj->getAllToken($module_op);
	// corresponding of token -> idst role
	$map_idst_token 	=& getModuleRoleSt($module_name, $all_token);
	// corresponding of level -> idst level
	$map_idst_level	 	=& getCustomLevelSt($id_custom);
	// old permission of all module
	$actual_perm		=& getAllModulesPermissionSt($map_idst_level, array_flip($map_idst_token));
	
	$re = true;
	foreach($levels as $lv => $name_level) {
		
		$idlevel = $map_idst_level[$lv];
		foreach($actual_perm[$lv] as $idrole => $v) {
			
			$acl_man->removeFromRole( $idrole, $idlevel );
		}
	}
	if($re) {
		$re = sql_query("
		DELETE FROM ".$GLOBALS['prefix_lms']."_menucustom_under 
		WHERE idMain = '".(int)$id_main."' AND idModule = '".(int)$id_module."'");
	}
	return $re;
}
Per supporto GRATUITO contattatemi in privato qui
wolk73
FormaLms User
Posts: 46
Joined: Fri Oct 26, 2012 11:03 am
Contact:

Re: Bug Comando Cancellazione voce di menu in "Gestione Menu"

Post by wolk73 »

Grazie alfa24, ora funziona!
Cambio status del Post.
CEO - SYCOP ITALIA
Network Internazionale di Professionisti d’alto livello Competente nel settore Web/ICT e Sicurezza UTM..
www.sycop.org
www.andreapatron.com
Post Reply