CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#12522] several files core correction

avatar
Created By: Philippe Thomas (filto)
Date Submitted: Thu Jan 27 03:29:53 -0500 2022

Assigned To: Fernando Morgado (JoMorg)
Version: 2.2.16
CMSMS Version: 2.2.16
Severity: Minor
Resolution: None
State: Open
Summary:
several files core correction
Detailed Description:
##########################################
core : lib/classes/AdminAlerts/

------------------------------------------
lib/classes/AdminAlerts/class.SimpleAlert.php

-----------
L72 (missing "throw news" and wrong syntax : "InvalidArgumentException")

if( $perms && (!is_array($perms) || !count($perms)) )
\InvalidArgumentExcecption('perms must be an array of permission name strings');

/*--correction--*/

if ($perms && (!is_array($perms) || !count($perms))) throw new
\InvalidArgumentException('perms must be an array of permission name strings');

-----------
L123 & 130 : (wrong syntax : "InvalidArgumentException" not
"InvalidArgumentExcecption")

------------------------------------------
lib/classes/AdminAlerts/class.TranslatableAlert.php
-----------
L123 & 130 : (wrong syntax : "InvalidArgumentException" not
"InvalidArgumentExcecption")


##########################################
core : lib/classes/Async/

------------------------------------------
lib/classes/Async/class.ExternalHandlerJob.php
-----------
L43 
namespace \CMSMS\Async;

/*--correction--*/

namespace CMSMS\Async;

L113 (missing \ )
UserTagOperations::get_instance()->$tmp();

/*--correction--*/

\UserTagOperations::get_instance()->$tmp();

------------------------------------------
lib/classes/Async/class.Job.php
-----------

L173 (missing \ )
$module =
ModuleOperations::get_instance()->get_module_instance(self::MODULE_NAME);

/*--correction--*/

$module =
\ModuleOperations::get_instance()->get_module_instance(self::MODULE_NAME);


##########################################
core : lib/classes/Contenttypes/

------------------------------------------
lib/classes/Contenttypes/Linc.inc.php
lib/classes/Contenttypes/PageLink.inc.php
lib/classes/Contenttypes/SectionHeader.inc.php
lib/classes/Contenttypes/Separator.inc.php

all define a function "EditAsArray" that use undefined function
"display_attributes".

Function "display_attributes" was still defined in cmsms 1.12.2 in
lib/classes/class.contentBase.php
but not anymore in cmsms version 2.x.x

functions "EditAsArray" of these 4 files, are used nowhere.

-----------
##########################################
core : lib/classes/Database/

------------------------------------------
lib/classes/Database/class.Connection.php

L595 (missing argument)

public function Time() { return $this->UnixTimeStamp(); }

/*--correction--*/

public function Time($str) { return $this->UnixTimeStamp($str); }

------------------------------------------
lib/classes/Database/class.EmptyRecordSet.php

This class impements lib/classes/Database/class.ResultSet.php

methods "Move" and "fetch_row" MUST be declared.
protected function Move($idx){}
protected function fetch_row(){}

method "GetAssoc" MUST have same parameters as defined in implemented class.
GetAssoc($force_array = false, $first2cols = false){}

wrong syntax of method "Fields" not 'fields'

method "Fields" MUST have same parameters as defined in implemented class.
public function Fields( $field = null )
------------------------------------------


##########################################
core : lib/classes/internal/

------------------------------------------
lib/classes/internal/class.CMS_Content_Block.php

L262 :
@trigger_error('Attempt to access module '.$key.' which could not be found (is
it properly installed and configured?');
/*--correction--*/
@trigger_error('Attempt to access module '.$modulename.' which could not be
found (is it properly installed and configured?');

L286 :( in foreach case default)

$parms[$key] = $val;
/*--correction--*/
$parms[$key] = $value;


------------------------------------------
lib/classes/internal/class.CmsExtendedModuleInfo.php

L44
$depinfo = new CmsExtendedModuleInfo($onedepkey);
/*--correction--*/
$depinfo = new CmsExtendedModuleInfo($onedepname);


------------------------------------------
lib/classes/internal/class.CmsModuleInfo.php

L203 and 206
replace $value by $val

L 211 214
replace $str by $res

L 230
$_write_ini_file($out,$fn);
/*--correction--*/
$_write_ini($out,$fn);

L234 and 237
replace $fn2 by $fn



##########################################
core : lib/classes/

-----------------------------------------------



-----------------------------------------------
lib/classes/class.cms_http_request.inc.php

L 782 : ( 'curl_setopt' not  'curl_setop' and CURLOPT_PROXY not CURL_PROXY)

curl_setop($ch,CURL_PROXY,$this->proxy);
/*--correction--*/
curl_setopt($ch,CURLOPT_PROXY,$this->proxy);

-----------------------------------------------
lib/classes/class.CmsAdminThemeBase.php

L156 CmsLogicException not CmsLogicExceptin

L1541
$message = $this->ShowMessage($this->Lang($params['tab_message']));
/*--correction--*/
$message = $this->ShowMessage(lang($params['tab_message']));

-----------------------------------------------
lib/classes/class.CmsException.php

L 134
 if( is_int($this->message) ) $this->messsage = 'CMSEX_'.$msg;
/*--correction--*/
 if( is_int($this->message) ) $this->messsage = 'CMSEX_'.$this->message;


-----------------------------------------------
lib/classes/class.CmsLayoutTemplate.php

L917
$query = CmsLayoutTemplateQuery(array('u'=>$n));

/*--correction--*/
$query = new CmsLayoutTemplateQuery(array('u'=>$n));
------

L1003

$grouplist = UserOperations::get_instance()->GetMemberGroups();
/*--correction--*/
$grouplist = UserOperations::get_instance()->GetMemberGroups($userid);

-----
L1100 : function process_by_name($name)

return $smarty->fetch('cms_template:name=' . $this->get_name());
/*--correction--*/
return $smarty->fetch('cms_template:name=' . $name);

-----------------------------------------------
lib/classes/class.CmsLayoutTemplateCategory.php

L80 (wrong syntax for debug error)

* @param sting $str The template type name.
/*--correction--*/
* @param string $str The template type name.


-----------------------------------------------
lib/classes/class.CmsLayoutTemplateType.php

L142
* @param sting $str The template type name.
/*--correction--*/
* @param string $str The template type name.

L317

$this->_dirty = true();
/*--correction--*/
$this->_dirty = true;

-----------------------------------------------
lib/classes/class.CMSModule

L612 and 616 ($realpath undefined)  replace $realpath by $value
 

-----------------------------------------------
lib/classes/class.ContentBase.inc.php

L2067 in method HasChildren :

$node = ContentOperations::get_instance()->quickfind_node_by_id($id);
/*--correction--*/
$node = ContentOperations::get_instance()->quickfind_node_by_id($this->mId);


-----------------------------------------------
lib/classes/class.group.inc

L255 in method RemovePermission wrong syntax missing e.

return $groupops->RemovPermission($this->id,$perm);
/*--correction--*/
return $groupops->RemovePermission($this->id,$perm);


-----------------------------------------------
lib/classes/class.groupoperations.inc

L192 undefined $db: add line tp store database instance in $db :
 
$query = 'DELETE FROM '.CMS_DB_PREFIX.'group_perms WHERE group_id = ? AND
perm_id = ?';
$dbr = $db->Execute($query,array($groupid,$permid));

/*--correction--*/
$db = CmsApp::get_instance()->GetDb();
$query = 'DELETE FROM '.CMS_DB_PREFIX.'group_perms WHERE group_id = ? AND
perm_id = ?';
$dbr = $db->Execute($query,array($groupid,$permid));


-----------------------------------------------
lib/classes/class.moduleoperations.inc.php

in method ExpandXMLPackage
L 314
$require = array();
# --replace $require by $requires
$requires = array();

-----------------------------------------------
lib/classes/class.useroperations.inc.php

L414 in methode IsSuperuser

$groups = $this->GetMemberGroups();
/*--correction--*/
$groups = $this->GetMemberGroups($uid);

----
##############

hope it help



History

Comments
avatar
Date: 2022-04-04 10:11
Posted By: Jean-Claude Etiemble (jce76350)

I confirm all these corrections
thanks @filto for this great work and I hope a developer will make the updates
soon
      
avatar
Date: 2022-04-20 18:37
Posted By: Philippe Thomas (filto)

update correction note :

  for php 7.1.0 compatibility
in my post :  replace is_countable by is_array 

as  Fernando Morgado said in [#12523] :

 "is_countable"e is not a solution as CMSMS TEAM aim to keep the PHP
compatible range as wide as possible.

      
avatar
Date: 2022-04-20 21:36
Posted By: Philippe Thomas (filto)

remove is_countable correction that  I want to add everywhere....
      
Updates

Updated: 2022-04-20 21:36
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException

Updated: 2022-04-20 18:37
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException

Updated: 2022-04-14 14:11
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException

Updated: 2022-04-13 23:08
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException

Updated: 2022-04-13 22:49
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException

Updated: 2022-04-13 21:51
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException

Updated: 2022-04-13 21:32
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException

Updated: 2022-01-27 20:14
description: ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException => ########################################## core : lib/classes/AdminAlerts/ ------------------------------------------ lib/classes/AdminAlerts/class.SimpleAlert.php ----------- L72 (missing "throw news" and wrong syntax : "InvalidArgumentException
resolution_id: => 5