Skip to content

Commit 68e20a1

Browse files
committed
Merge pull request #34 from Scott-Cam/master
Fixes/changes to compatibility wrapper
2 parents 28f30d1 + e1e0d90 commit 68e20a1

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

ToolkitApi/CW/cw.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,9 +2266,11 @@ function i5_spool_list($description = array(), $connection = null)
22662266

22672267
// if outq is not *ALL, it should have a library name
22682268
if (($outq != '*ALL') && empty($outqLibName)) {
2269+
// Try *LIBL
2270+
$outqLibName = '*LIBL';
22692271
// if no libname, result set will be empty, so might as well alert the user.
2270-
i5ErrorActivity(I5_ERR_PHP_ELEMENT_MISSING, I5_CAT_PHP, 'Missing outq library', 'You specified an outq but did not qualify it with a library name.');
2271-
return false;
2272+
//i5ErrorActivity(I5_ERR_PHP_ELEMENT_MISSING, I5_CAT_PHP, 'Missing outq library', 'You specified an outq but did not qualify it with a library name.');
2273+
// return false;
22722274
}
22732275
}
22742276

@@ -2755,7 +2757,8 @@ function listRead(&$list)
27552757
// we simply have no more records to receive.
27562758
$errorCode = $connection->getErrorCode();
27572759
if ($errorCode == '' || $errorCode == 'GUI0006' || $errorCode == 'GUI0001') {
2758-
i5ErrorActivity(I5_ERR_BEOF, I5_CAT_PHP, 'No more entries.', 'No more entries.');
2760+
// EOF is not an error, just clogs the log, completely normal, happens to everyone...
2761+
//i5ErrorActivity(I5_ERR_BEOF, I5_CAT_PHP, 'No more entries.', 'No more entries.');
27592762
} else {
27602763
// a real error.
27612764
i5CpfError($errorCode, $connection->getErrorMsg());

ToolkitApi/CW/cwclasses.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ public function splitPcmlProgramPath($path)
585585
* and return the value associated with the key name provided.
586586
*
587587
* @param string $searchKey key to search for
588-
* @return string|array|null value found in input array for array key. null if failed
588+
* @return string|array|false value found in input array for array key. false if failed
589589
*/
590590
protected function findValueInArray($searchKey, $valueArray)
591591
{
@@ -594,7 +594,7 @@ protected function findValueInArray($searchKey, $valueArray)
594594
// ensure that array is not empty
595595
if (!count($valueArray)) {
596596
i5ErrorActivity(I5_ERR_PHP_TYPEPARAM, I5_CAT_PHP, "Array of input values must not be empty", "Array of input values must not be empty");
597-
return null;
597+
return false;
598598
}
599599

600600
foreach ($valueArray as $key=>$value) {
@@ -608,7 +608,7 @@ protected function findValueInArray($searchKey, $valueArray)
608608

609609
// if failed, return null
610610
// $connection->logThis("findValueInArray: searchKey: $searchKey. no value found");
611-
return null;
611+
return false;
612612
}
613613

614614
/**
@@ -778,8 +778,9 @@ protected function oldToNewDescriptionItem($oldDataDescription = array(), $input
778778
// Look up its value (could be another data structure or a single value)
779779
// in the input array, based on data structure name.
780780
$dsData = $this->findValueInArray($dsName, $inputValues);
781-
782-
if (!$dsData) {
781+
// Compare with false since this is what findValueInArray returns on error
782+
// this will prevent things such as empty arrays from causing errors
783+
if ($dsData === false) {
783784
// ds has no description to match value!
784785
i5ErrorActivity(I5_ERR_PARAMNOTFOUND, I5_CAT_PHP, "Requested parameter '$dsName' does not exist in the input data", "Requested parameter $dsName does not exist in the input data");
785786
return false;

0 commit comments

Comments
 (0)