mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Qual: Fix PhanTypeExpectedObjectOrClassName by testing on classname
# Qual: Fix PhanTypeExpectedObjectOrClassName by testing on classname PhanTypeExpectedObjectOrClassName should be fixed by testing that the classname is not empty.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
|
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -105,18 +106,16 @@ if ($action == 'updateMask') {
|
|||||||
// Search template files
|
// Search template files
|
||||||
$file = '';
|
$file = '';
|
||||||
$classname = '';
|
$classname = '';
|
||||||
$filefound = 0;
|
|
||||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
foreach ($dirmodels as $reldir) {
|
foreach ($dirmodels as $reldir) {
|
||||||
$file = dol_buildpath($reldir."core/modules/reception/doc/pdf_".$modele.".modules.php", 0);
|
$file = dol_buildpath($reldir."core/modules/reception/doc/pdf_".$modele.".modules.php", 0);
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$filefound = 1;
|
|
||||||
$classname = "pdf_".$modele;
|
$classname = "pdf_".$modele;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filefound) {
|
if ($classname !== '') {
|
||||||
require_once $file;
|
require_once $file;
|
||||||
|
|
||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|||||||
Reference in New Issue
Block a user