Skip to content

Commit

Permalink
remove debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
franzholz committed Dec 21, 2021
1 parent 4ec23a3 commit 8189298
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,10 @@ public function main()
if ($information == '') {
$information = $GLOBALS['LANG']->getLL('no_alternative_product');
}
debug ($information, '$information Pos 2');
} else if (
isset($errorLanguageCodeArray) && is_array($errorLanguageCodeArray)
) {
debug ($errorLanguageCodeArray, '$errorLanguageCodeArray Pos 2');
foreach ($errorLanguageCodeArray as $table => $codeArray) {
debug ($table, '$table');
debug ($codeArray, '$codeArray');
$code = '';
$parameter = '';
if (isset($codeArray['code'])) {
Expand All @@ -167,22 +163,17 @@ public function main()
if (isset($codeArray['parameter'])) {
$parameter = $codeArray['parameter'];
}
debug ($code, '$code');

switch ($code) {
case 'no_texts':
debug ($code, '$code Pos 2');
$information .= $GLOBALS['LANG']->getLL($code);
debug ($information, '$information Pos 3');
break;
case 'no_alternative_product':
$information .= sprintf($GLOBALS['LANG']->getLL($code), $parameter);
break;
}
}
}
debug ($information, '$information Pos 4');

$assigns['information'] = $information;
} else {
// CSH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public function main()
$infoArray,
$_REQUEST['id']
);
debug ($infoArray, '$infoArray ');

$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(
'EXT:' . TT_PRODUCTS_EXT . '/Resources/Private/Templates/ImportFalFinished.html'
Expand All @@ -130,10 +129,8 @@ public function main()

$assigns['menu'] = $menu;
}
debug ($assigns, '$assigns');
$view->assignMultiple($assigns);
$out = $view->render();
debug ($out, 'main ENDE $out');
return $out;
}

Expand Down
6 changes: 0 additions & 6 deletions Classes/Utility/CreateLanguagesUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@ static public function createAll (
&$errorLanguageCodeArray,
$currId
) {
debug($tmp, 'moveAll ');
debug ($_REQUEST, '$_REQUEST');
$result = true;
$infoArray = array();

debug ($currId, '$currId');

if($currId) {
$tableArray = array('tt_products_texts' => 'tt_products_texts_language');
// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
Expand Down Expand Up @@ -173,8 +169,6 @@ static public function createAll (
}
}

debug ($theOutput, 'MODFUNC1 ENDE $result');
debug ($infoArray, 'MODFUNC1 ENDE $infoArray');
return $result;
}
}
Expand Down
31 changes: 0 additions & 31 deletions Classes/Utility/ImportFalUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ static public function importAll (
&$infoArray,
$currId
) {
debug($tmp, 'importAll ');
debug ($_REQUEST, '$_REQUEST');
$result = true;
$infoArray = array();

Expand All @@ -70,10 +68,6 @@ static public function importAll (
} else {
$targetFolder = $storage->getFolder('/' . $targetDirectory);
}
debug ($targetFolder, '$targetFolder +++');
/** @var $fileRepository \TYPO3\CMS\Core\Resource\FileRepository */
// $fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');

$content = '';
$pid = intval($currId);
$tableMediaArray = array(
Expand All @@ -85,7 +79,6 @@ static public function importAll (

foreach ($tableMediaArray as $tablename => $imageFieldnameArray) {
$imageCount = 0;
debug ($tablename, '$tablename');
foreach ($imageFieldnameArray as $imageFieldname) {
$imageFalFieldname = $imageFieldname . '_uid';

Expand All @@ -96,25 +89,19 @@ static public function importAll (
'pid=' . $pid . ' AND deleted=0'
);

debug ($rowArray, '$rowArray');

if (is_array($rowArray) && count($rowArray)) {

foreach ($rowArray as $k => $row) {
// if ($k != 3) continue; // Test
debug ($row, '$row');

if ($row[$imageFieldname] != '') {
$imageArray = explode(',', $row[$imageFieldname]);
$sysfileRowArray = array();
debug ($imageArray, '$imageArray');
if (intval($row[$imageFalFieldname]) != 0) {
debug ($row[$imageFalFieldname], '$row['. $imageFalFieldname . '] TODO');

$where_clause = 'uid_foreign=' . intval($row['uid']) . ' AND tablenames="' . $tablename . '" AND fieldname="' . $imageFalFieldname . '"' ;
$where_clause .= \JambageCom\Div2007\Utility\TableUtility::deleteClause('sys_file_reference');

debug ($where_clause, '$where_clause');
$sysfileRowArray =
$GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
Expand All @@ -125,16 +112,12 @@ static public function importAll (
'',
'uid_local'
);
debug ($sysfileRowArray, '$sysfileRowArray');
}

debug ($imageArray, '$imageArray vor Schleife');
if (!empty($imageArray)) {
$imageCount = count($imageArray);
$needsCountUpdate = false;
foreach ($imageArray as $imageKey => $image) {
debug ($imageKey, '$imageKey');
debug ($image, '$image');
$imageFile = '/user_upload/' . $image;
$fileIdentifier = '1:' . $imageFile;

Expand All @@ -146,11 +129,9 @@ static public function importAll (

if (!file_exists(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/' . $targetFileName)) {
$fullSourceFileName = \TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/' . self::ORIGINAL_DIRECTORY . $image;
debug ($fullSourceFileName, '$fullSourceFileName');
// Move the file to the storage and index it (indexing creates the sys_file entry)
$file = $storage->addFile($fullSourceFileName, $targetFolder, '', 'cancel');
// $fileRepository->addToIndex($file);
debug ($targetFolder, 'added to $targetFolder');
}

if (
Expand All @@ -162,15 +143,11 @@ static public function importAll (
}

$file = $resourceFactory->getFileObjectFromCombinedIdentifier($fileIdentifier);
debug ($file, '$file');
if ($file instanceof \TYPO3\CMS\Core\Resource\File) {
$fileUid = $file->getUid();
// $properties = $file->getProperties();
// $fileInfo = $storage->getFileInfo($file);
debug ($fileUid, '$fileUid');
debug ($sysfileRowArray[$fileUid], '$sysfileRowArray['.$fileUid.']');

// debug ($properties, '$properties');
if (
empty($sysfileRowArray) ||
!isset($sysfileRowArray[$fileUid])
Expand All @@ -184,16 +161,13 @@ static public function importAll (
'pid' => $pid, // parent id of the parent page
'table_local' => 'sys_file',
);
// $data[$tablename][$row['uid']] = array($imageFalFieldname => $imageCount); // set to the number of images

if (!empty($sysfileRowArray)) {
$needsCountUpdate = true;
} else {
$data[$tablename][$row['uid']] = array($imageFalFieldname => 'NEW1234');
}

debug ($data, 'INSERT $data');

/** @var \TYPO3\CMS\Core\DataHandling\DataHandler $tce */
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\DataHandling\DataHandler'); // create TCE instance
$tce->start($data, array());
Expand All @@ -206,8 +180,6 @@ static public function importAll (
}
}
}
debug ($imageKey, '$imageKey Pos 3');
debug ($image, '$image Pos 3');
$imageCount++;
} // foreach ($imageArray

Expand All @@ -226,10 +198,7 @@ static public function importAll (
$infoArray[$tablename] = $imageCount;
} // foreach

debug ($theOutput, 'MODFUNC3 ENDE $theOutput');

return $result;
}
}


6 changes: 0 additions & 6 deletions Classes/Utility/MoveItemsUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ static public function moveAll (
$destId,
$age
) {
debug($tmp, 'moveAll ');
debug ($_REQUEST, '$_REQUEST');
$result = true;
$infoArray = array();

debug ($currId, '$currId');

if($currId && $destId) {
$infoArray['rows'] = array();
$fieldsArray = array();
Expand All @@ -73,8 +69,6 @@ static public function moveAll (
}
}

debug ($theOutput, 'MODFUNC1 ENDE $result');
debug ($infoArray, 'MODFUNC1 ENDE $infoArray');
return $result;
}
}
Expand Down

0 comments on commit 8189298

Please sign in to comment.