Fix bug : new document w/o description

Change  print_r by var_export
Improve PHPUNIT
This commit is contained in:
sparkyx 2023-01-08 20:22:37 +01:00
parent 4b0ee7b0e1
commit b3674eaa7b
6 changed files with 18 additions and 9 deletions

View file

@ -167,7 +167,7 @@ class contact extends Fiche
} }
$ps_sql .= $limit ; $ps_sql .= $limit ;
if (DEBUGNOALYSS > 1) { if (DEBUGNOALYSS > 1) {
print_r("Contact::fetch ($ps_sql)"); var_export("Contact::fetch ($ps_sql)");
} }
return $this->cn->get_array($ps_sql); return $this->cn->get_array($ps_sql);
} }

View file

@ -1403,9 +1403,9 @@ function is_msie()
*/ */
function record_log($p_message) function record_log($p_message)
{ {
error_log("noalyss".print_r($p_message,true),0); error_log("noalyss".var_export($p_message,true),0);
error_log("noalyss GET [".json_encode($_GET)."]"); error_log("noalyss GET [".json_encode($_GET,0,10)."]");
error_log("_POST [".json_encode($_POST)."]",0); error_log("_POST [".json_encode($_POST,0,10)."]",0);
} }
if(!function_exists('tracedebug')) { if(!function_exists('tracedebug')) {
function tracedebug($file,$var, $label = NULL) { function tracedebug($file,$var, $label = NULL) {
@ -1685,4 +1685,4 @@ function linkTo($p_url)
} else { } else {
return $p_url; return $p_url;
} }
} }

View file

@ -47,7 +47,7 @@ class HttpInput
} }
public function __toString(): string public function __toString(): string
{ {
return "http_input".print_r($this,true); return "http_input".var_export($this,true);
} }
public function get_array() public function get_array()
{ {

View file

@ -1530,7 +1530,7 @@ function check()
} }
/** /**
* @brief usually contain a link and calls another page, it must overriden * @brief usually contain a link and calls another page, it must be overriden
* @param array $p_row is the current database row * @param array $p_row is the current database row
* @return void * @return void
*/ */

View file

@ -308,8 +308,15 @@ function small(p_id_textarea){
echo '<div class="textarea" style="margin-left:5%;margin-right:5%;margin-bottom:1rem;width:90%;">'; echo '<div class="textarea" style="margin-left:5%;margin-right:5%;margin-bottom:1rem;width:90%;">';
echo $description->input(); echo $description->input();
echo '</div>'; echo '</div>';
} else { } elseif ( $p_view != 'READ' ) {
// no description and no comment // no description and no comment it is a new document
echo h2(_("Description"));
$description->set_enrichText('enrich');
$description->style='style="height:250px;width:90%;"';
echo '<div class="textarea" style="margin-left:5%;margin-right:5%;margin-bottom:1rem;width:90%;">';
echo $description->input();
echo '</div>';
} }

View file

@ -19,6 +19,8 @@
*/ */
// Copyright Author Dany De Bontridder danydb@aevalys.eu // Copyright Author Dany De Bontridder danydb@aevalys.eu
define ('NOALYSS_URL','PHPUNIT');
define ('DIRTEST',__DIR__);
/** /**
* constant.php contains a autoloader for classes * constant.php contains a autoloader for classes