[TikiWiki-commits] [Git][tikiwiki/tiki][master] [REF] Cleanup unnecessary comments print_r, var_dump, die, etc used in...
Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <689d3e931f50a_2ca954c062196@gitlab-sidekiq-low-urgency-cpu-bound-v2-64f48ff576-t9qf7.mail> |
Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
f997da07 by Alain Cisirika at 2025-08-14T01:32:33+00:00
[REF] Cleanup unnecessary comments print_r, var_dump, die, etc used in debugging process but not removing after work
---
* [ENH] Cleanup unnecessary comments print_r, var_dump, die, etc used in debugging process but not removing after work
See merge request tikiwiki/tiki!8273
- - - - -
22 changed files:
- doc/devtools/search_smarty_prefs-2.0.php
- lib/IconGenerator.php
- lib/Sheet/excel/reader.php
- lib/Sheet/sheetlib.php
- lib/Theme/ThemeLib.php
- lib/admin/adminlib.php
- lib/core/Search/Indexer.php
- lib/core/Tiki/Command/DevbuildwsconfsCommand.php
- lib/core/Tiki/Profiling/DatabaseQueryLog.php
- lib/core/Tiki/Smarty/SmartyTiki.php
- lib/core/Tracker/Definition.php
- lib/core/Tracker/Field/Action.php
- lib/core/Tracker/Field/Math.php
- lib/core/WikiPlugin/Negotiator/Wiki.php
- lib/wiki-plugins/wikiplugin_articles.php
- lib/wiki-plugins/wikiplugin_kanban.php
- lib/wiki-plugins/wikiplugin_trackeritemcopy.php
- templates/modules/mod-cookiesettings.tpl
- templates/search/list/table.tpl
- tiki-download_item_attachment.php
- tiki-download_wiki_attachment.php
- tiki-list_file_gallery.php
Changes:
=====================================
doc/devtools/search_smarty_prefs-2.0.php
=====================================
@@ -46,7 +46,6 @@ foreach ($elems as $filename) {
}
}
if (count($gmatchs)) {
- //var_dump($matchs);
echo "$filename: " . implode(', ', $gmatchs) . "\n";
}
}
=====================================
lib/IconGenerator.php
=====================================
@@ -37,7 +37,6 @@ class IconGenerator
public function generateIconArraysFromCss($bootstrapIcons, $fontAwesomeIcons): array
{
- //var_dump($fontAwesomeIcons);
$bootstrapPattern = '/\.bi-([a-zA-Z0-9-]+)::before/';
/**
* faClassPattern matches a selector starting with .fa- and faUnicodePattern
=====================================
lib/Sheet/excel/reader.php
=====================================
@@ -174,10 +174,7 @@ class Spreadsheet_Excel_Reader
*/
- //var_dump($this->data);
-
$this->pos = 0;
- //$this->readRecords();
return $this->_parse();
}
@@ -200,7 +197,6 @@ class Spreadsheet_Excel_Reader
return false;
}
- //print_r($rec);
$pos += $length + 4;
$code = ord($this->data[$pos]) | ord($this->data[$pos+1])<<8;
@@ -314,9 +310,6 @@ class Spreadsheet_Excel_Reader
if ($extendedString) {
$spos += $extendedRunLength;
}
- //if ($retstr == 'Derby'){
- // echo "bb\n";
- //}
$this->sst[]=$retstr;
}
/*$continueRecords = array();
=====================================
lib/Sheet/sheetlib.php
=====================================
@@ -279,7 +279,6 @@ class SheetLib extends TikiLib
$sheets[$sheet['sheetId']] = $sheet;
}
}
- //print_r($sheets);
$results = [];
$results['data'] = $sheets;
@@ -292,7 +291,6 @@ class SheetLib extends TikiLib
}
}
- //print_r($results);
$results['count'] = $this->getOne("SELECT COUNT(*) FROM `tiki_sheets` $mid", $bindvars);
return $results;
=====================================
lib/Theme/ThemeLib.php
=====================================
@@ -139,7 +139,6 @@ class ThemeLib extends TikiLib
//Base tiki themes
$paths[] = BASE_THEMES_SRC_PATH;
- //var_dump($paths);
return $paths;
}
@@ -159,8 +158,6 @@ class ThemeLib extends TikiLib
$themes = array_merge($themes, self::getThemes($lookupPath));
}
$themes = array_unique($themes);
- //var_dump($themes);
- //die;
return $themes;
}
@@ -380,20 +377,17 @@ class ThemeLib extends TikiLib
if ($option) {
$path = $realLookupPath .
$themePathFragment . $themeOptionPathFragment . $suffixFragment;
- //var_dump("Looking for: $path");
if (file_exists($path)) {
break;
}
}
// try "parent" theme dir if no option one
$path = $realLookupPath . $themePathFragment . $suffixFragment;
- //var_dump("Looking for (fallback): $path");
if (file_exists($path)) {
break;
}
$path = null;
}
- //var_dump("getThemePath($theme, $option, $pathFragment, $returnPrivatePath)", $path);
return $path;
}
=====================================
lib/admin/adminlib.php
=====================================
@@ -421,7 +421,6 @@ class AdminLib extends TikiLib
$data = "<html>";
$data .= "<head>";
$data .= "<title>" . $res["pageName"] . "</title>";
- // $data .= "<link rel='StyleSheet' href='styles/" . $prefs['style'] . "' type='text/css'>";
$data .= '</head>';
$data .= "<body><a class='wiki' href='" .
$prefs['wikiHomePage'] .
=====================================
lib/core/Search/Indexer.php
=====================================
@@ -409,7 +409,6 @@ class Search_Indexer
'object_id' => $typeFactory->identifier($objectId),
'contents' => $typeFactory->plainmediumtext($this->getGlobalContent($data, $globalFields)),
];
- //var_dump($globalFields);
$data = array_merge(array_filter($data), $base);
$data = $this->applyFilters($data);
=====================================
lib/core/Tiki/Command/DevbuildwsconfsCommand.php
=====================================
@@ -77,7 +77,6 @@ class DevbuildwsconfsCommand extends Command
$filePath = $o_path->getRealpath();
$folders = explode(\DIRECTORY_SEPARATOR, $filePath);
$folderName = end($folders);//This is a string...
- //var_dump($folders);
$folder = count($folders);
$excludeDir = [
@@ -95,7 +94,6 @@ class DevbuildwsconfsCommand extends Command
if ($o_path->isDir() && str_starts_with($folderName, '.')) {// UNIX directories that are hidden (Ex: .composer)
- //var_dump($folderName);
return false;
}
=====================================
lib/core/Tiki/Profiling/DatabaseQueryLog.php
=====================================
@@ -199,9 +199,6 @@ class DatabaseQueryLog
}
}
}
- //echo "<pre>";
- //var_dump($log[3]);
- //echo "</pre>";
return $log;
}
=====================================
lib/core/Tiki/Smarty/SmartyTiki.php
=====================================
@@ -560,20 +560,20 @@ class SmartyTiki extends Smarty
}
/**
- Add smarty template paths from where tpl files should be loaded. This function also gets called from lib/setup/theme.php to initialize theme specific paths. It's dependent on
+ * Add smarty template paths from where tpl files should be loaded. This function also gets called from lib/setup/theme.php to initialize theme specific paths. It's dependent on
- $prefs['theme'], $prefs['theme_option'], $prefs['site_layout'], $prefs['site_layout_admin']
+ * $prefs['theme'], $prefs['theme_option'], $prefs['site_layout'], $prefs['site_layout_admin']
- The load order for main templates is
- - theme_option path
- - theme path
- - themes/templates/
- - tikidomain path
- - tiki extension modules templates/
- - templates/ (at project root)
+ * The load order for main templates is
+ * - theme_option path
+ * - theme path
+ * - themes/templates/
+ * - tikidomain path
+ * - tiki extension modules templates/
+ * - templates/ (at project root)
- The effective template will be the one present in the last directory loaded.
+ * The effective template will be the one present in the last directory loaded.
*/
public function initializePaths(): void
{
=====================================
lib/core/Tracker/Definition.php
=====================================
@@ -85,7 +85,6 @@ class Tracker_Definition
$trklib = TikiLib::lib('trk');
$trackerInfos = $trklib->list_trackers(0, -1, 'trackerId_asc');
$definitions = [];
- //var_dump($trackerInfos['list']);
foreach ($trackerInfos['list'] as $id => $name) {
$definition = self::get($id);
$definitions[] = $definition;
=====================================
lib/core/Tracker/Field/Action.php
=====================================
@@ -4,7 +4,6 @@
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-//print_r(\Tracker\Field\AbstractItemField);
class Tracker_Field_Action extends \Tracker\Field\AbstractItemField implements \Tracker\Field\ItemFieldInterface
{
=====================================
lib/core/Tracker/Field/Math.php
=====================================
@@ -373,7 +373,6 @@ class Tracker_Field_Math extends \Tracker\Field\AbstractItemField implements \Tr
} elseif ($item) {
$item[$mirrorFieldId] = $this->getData($this->getConfiguration('permName'));
}
- //var_dump($mirrorFieldInfo, $item);
$handler = TikiLib::lib('trk')->get_field_handler($mirrorFieldInfo, $item);
$this->mirrorFieldBaseKey = $handler->getBaseKey();
}
=====================================
lib/core/WikiPlugin/Negotiator/Wiki.php
=====================================
@@ -258,7 +258,6 @@ class WikiPlugin_Negotiator_Wiki
break;
}
}
- //var_dump($pluginPhpFilePath, $exists);
return $exists ? $pluginPhpFilePath : null;
}
=====================================
lib/wiki-plugins/wikiplugin_articles.php
=====================================
@@ -493,7 +493,6 @@ function wikiplugin_articles($data, $params)
$comments_object_var = $listpages["data"][$i]["articleId"];
$comments_objectId = $comments_prefix_var . $comments_object_var;
$listpages["data"][$i]["comments_count"] = TikiLib::lib('comments')->count_comments($comments_objectId);
- //print_r($listpages["data"][$i]['title']);
}
$topics = $artlib->list_topics();
=====================================
lib/wiki-plugins/wikiplugin_kanban.php
=====================================
@@ -60,24 +60,24 @@ function wikiplugin_kanban_info(): array
'name' => tr('Column acceptable values and configuration'),
'description' => tr('For the tracker field mapped in "column", defines for each column the value a tracker item must have for that field, as well as the label displayed as the column header and the WiP limit for that column. Implicitely defines the number of columns and in which order they are shown; You can skip values so they are not part of the board (and you typically do, if only to eventually archive done cards).
-The parameter is and array of colon separated values, each containing a coma separated arguments configuring the column.
+ The parameter is and array of colon separated values, each containing a coma separated arguments configuring the column.
-In order, the configuration represent the:
+ In order, the configuration represent the:
-1) Mandatory. The value the mapped field must have in the tracker item for the card to be shown in the matching column.
-2) Optional. If present and not "null", the text to be displayed as the column header instead of the normal tracker field label for the value above. (For example "Done" instead of "Closed")
-3) Optional. If present and not "null", the WiP (Work in Progress) limit for the cards in the column. In "null", there is no limit for the number of cards in the column. Typically you will use null for the first and last column.
+ 1) Mandatory. The value the mapped field must have in the tracker item for the card to be shown in the matching column.
+ 2) Optional. If present and not "null", the text to be displayed as the column header instead of the normal tracker field label for the value above. (For example "Done" instead of "Closed")
+ 3) Optional. If present and not "null", the WiP (Work in Progress) limit for the cards in the column. In "null", there is no limit for the number of cards in the column. Typically you will use null for the first and last column.
-null or nothing between the comas means the parameter is not set. Necessary since the arguments are positional.
+ null or nothing between the comas means the parameter is not set. Necessary since the arguments are positional.
-So for example:
-someValue,someAlternateTextToDisplay,null:someOtherValue,,4
+ So for example:
+ someValue,someAlternateTextToDisplay,null:someOtherValue,,4
-Means the board would have two colums, the first column would be titled "someAlternateTextToDisplay" containing cards with the value "someValue" for the mapped field and no limit to the number of cards. The second column would have cards with "someOtherValue" for the mapped field, with whatever the label is for that value in the field definition, and the column would be highlighted red if there is more than 4 cards. No card with any other value would be anywhere on the board.
+ Means the board would have two colums, the first column would be titled "someAlternateTextToDisplay" containing cards with the value "someValue" for the mapped field and no limit to the number of cards. The second column would have cards with "someOtherValue" for the mapped field, with whatever the label is for that value in the field definition, and the column would be highlighted red if there is more than 4 cards. No card with any other value would be anywhere on the board.
-To allow empty values, include a field with an empty value (ex: someValue:someOtherValue:,Unsorted cards)
+ To allow empty values, include a field with an empty value (ex: someValue:someOtherValue:,Unsorted cards)
-If the whole parameter is absent (not recommended), all possible field values will be used to generate columns (except the empty value).
+ If the whole parameter is absent (not recommended), all possible field values will be used to generate columns (except the empty value).
'),
'hint' => tr('e.g. "someValue,someAlternateTextToDisplay,null:someOtherValue,,4"'),
@@ -126,7 +126,6 @@ If the whole parameter is absent (not recommended), all possible field values wi
function _map_field($fieldHandler, string $fieldValuesParamName, $fieldValuesParam, string $fieldPermName, array $fieldDefaultConfig)
{
- //echo '<pre>Field';print_r($fieldHandler->getFieldDefinition());echo '</pre>';
if ($fieldHandler instanceof \Tracker\Field\EnumerableInterface) {
if ($fieldHandler->canHaveMultipleValues()) {
throw new TypeError(tra('The tracker field "%0" selected in parameter is configured to allow multiple values. This is not mappable in a kanban board', '', false, [
@@ -140,7 +139,6 @@ function _map_field($fieldHandler, string $fieldValuesParamName, $fieldValuesPar
]));
}
- //echo '<pre>Possible item values';print_r($fieldValuesMap);echo '</pre>';
$fieldInfo = [];
$appendAllPossibleFieldValues = false;
@@ -160,7 +158,6 @@ function _map_field($fieldHandler, string $fieldValuesParamName, $fieldValuesPar
foreach ($fieldValuesMap as $value => $label) {
$fieldInfo[$value] = array_merge($fieldDefaultConfig, ['title' => $label, 'value' => $value]);
}
- //echo'<pre>';print_r($fieldInfo);echo '</pre>';
}
if (is_array($fieldValuesParam) && ! empty($fieldValuesParam)) {
foreach ($fieldValuesParam as $key => $fieldParams) {
@@ -176,7 +173,6 @@ function _map_field($fieldHandler, string $fieldValuesParamName, $fieldValuesPar
implode(',', array_keys($fieldValuesMap))
]));
}
- //echo '<pre>';print_r($fieldValue);echo '</pre>';
if ($fieldValue !== '') {
$fieldData = ['title' => $fieldValuesMap[$fieldValue], 'value' => $fieldValue];
} else {
@@ -203,7 +199,6 @@ function _map_field($fieldHandler, string $fieldValuesParamName, $fieldValuesPar
}
}
- //echo '<pre>_map_field returning:';print_r($fieldInfo);echo '</pre>';
return $fieldInfo;
}
function wikiplugin_kanban(string $data, array $params): WikiParser_PluginOutput
@@ -302,16 +297,12 @@ function wikiplugin_kanban(string $data, array $params): WikiParser_PluginOutput
} catch (TypeError $e) {
return WikiParser_PluginOutput::userError($e);
}
-
-
- //echo '<pre>';print_r($columnsInfo);echo '</pre>';
//END mapping the fields
//Begin mapping the cards
$query = new Search_Query();
$query->filterType('trackeritem');
$query->filterContent((string)$jit->boardTrackerId->int(), 'tracker_id');
- //print_r(array_keys($swimlanesInfo));
//Filter the cards
//We only filter the swimlane or column field values if we don't allow empty values. Search_Query cannot include specific values plus the empty ones.
@@ -386,7 +377,6 @@ function wikiplugin_kanban(string $data, array $params): WikiParser_PluginOutput
$entries = $formatter->getPopulatedList($result, false);
$entries = $plugin->renderEntries($entries);
- //echo '<pre>TrackerQueryResults:\n';print_r($entries);echo '</pre>';
$boardCards = [];
@@ -522,7 +512,6 @@ function wikiplugin_kanban(string $data, array $params): WikiParser_PluginOutput
'user' => $user,
'CASLAbilityRules' => $caslAbilities
];
- //echo ("<pre>");var_dump($kanbanData);echo ("</pre>");
$smarty->assign(
'kanbanData',
$kanbanData
@@ -534,7 +523,6 @@ function wikiplugin_kanban(string $data, array $params): WikiParser_PluginOutput
');
$out = "";
- //$out = str_replace(['~np~', '~/np~'], '', $formatter->renderFilters());
$out .= $smarty->fetch('wiki-plugins/wikiplugin_kanban.tpl');
=====================================
lib/wiki-plugins/wikiplugin_trackeritemcopy.php
=====================================
@@ -158,8 +158,6 @@ function wikiplugin_trackeritemcopy($data, $params)
$updateFieldValues[] = $itemLinkId;
}
- //print_r(array($trackerId, $updateFieldIds, $updateFieldValues, $copyFieldIds, $itemIds, $linkFieldId, $itemLinkId, $copies));
-
for ($i = 0, $count_updateFieldIds = count($updateFieldIds); $i < $count_updateFieldIds; $i++) {
$ins_fields["data"][] = [
'options_array' => $fieldOptionsArray[$updateFieldIds[$i]],
=====================================
templates/modules/mod-cookiesettings.tpl
=====================================
@@ -1,5 +1,4 @@
{tikimodule error=$module_params.error title=$tpl_module_title name="cookiesettings" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}{strip}
-{* <pre>{$module_params|var_dump}</pre>*}
<a href="{$base_uri}{if $base_uri|strpos:'?' === false}?{else}&{/if}cookie_consent" title="|{$module_params.text}" class="tips {$module_params.textclass}">
{if $module_params.mode eq 'both' or $module_params.mode eq 'icon'}{icon name=$module_params.icon size=$module_params.iconsize}{/if}
{if $module_params.mode eq 'both' or $module_params.mode eq 'text'}{$module_params.text}{/if}
=====================================
templates/search/list/table.tpl
=====================================
@@ -12,8 +12,6 @@
{/if}
{$showFacets = not empty($facets) and isset($tableparams.facets) and $tableparams.facets eq 'y'}
{if $showFacets}
-{* <pre>{$facets|var_dump}</pre>*}
-{* <pre>{$results|var_dump}</pre>*}
<div class="row">
<div class="col-sm-2">
<div class="facets filters" id="filters">
=====================================
tiki-download_item_attachment.php
=====================================
@@ -52,12 +52,9 @@ $file = $info["filename"];
$content = $info["data"];
session_write_close();
-//print("File:$file<br />");
-//die;
TikiLib::lib('header')->setXRobotsTag($robots);
header("Content-type: $type");
if (isset($_REQUEST["display"])) {
-//die;
header("Content-Disposition: inline; filename=\"" . urlencode($file) . "\"");
} else {
header("Content-Disposition: attachment; filename=\"$file\"");
=====================================
tiki-download_wiki_attachment.php
=====================================
@@ -34,8 +34,6 @@ $file = $info["filename"];
$content = $info["data"];
session_write_close();
-//print("File:$file<br />");
-//die;
header("Content-type: $type");
TikiLib::lib('header')->setXRobotsTag($robots);
=====================================
tiki-list_file_gallery.php
=====================================
@@ -1183,7 +1183,6 @@ if (isset($_GET['slideshow'])) {
$categlib = TikiLib::lib('categ');
foreach ($files['data'] as &$file) {
$file['categs'] = $categlib->get_object_categories('file', $file['fileId']);
- // var_dump($file['categs']);
if (is_array($file['categs'])) {
$file['categs'] = array_map(function ($c) {
return $c['name'];
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f997da072ef8a727cfca3f54f396e6a936711186
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f997da072ef8a727cfca3f54f396e6a936711186
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs