Bug #40424 [Opn->Fbk]: Fatal error when setting the value of COM object's property array
| From: | cmb@php.net | Date: | Mon, 21 Oct 2019 10:24:15 +0000 |
| Subject: | Bug #40424 [Opn->Fbk]: Fatal error when setting the value of COM object's property array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223324@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=40424&edit=1
ID: 40424
Updated by: cmb@php.net
Reported by: lee at dark-circuit dot com
Summary: Fatal error when setting the value of COM object's
property array
-Status: Open
+Status: Feedback
Type: Bug
Package: COM related
Operating System: Windows XP SP2
PHP Version: 5CVS-2007-02-10 (snap)
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Is this still an issue?
Previous Comments:
------------------------------------------------------------------------
[2007-04-16 22:45:56] lee at dark-circuit dot com
Still Getting same problem on suggested snapshot, will put together a test case as soon as possible.
------------------------------------------------------------------------
[2007-04-12 15:13:40] wharmby@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Hi Lee
Is this still an issue for you with latest 5.2 snapshot
builds ?
With snapshot build of April 10th 2007 I am unable to recreate the
issue your report in this defect. Unfortunatley I do not have the pre-requisite software (PawCom and
Peachtree accounting software ?)
to run your supplied testcase so I have hacked togther one which I
believe does something very similar using Excel as follows:
<?php
if (file_exists("c:/COM/Sample2.xls")) {
unlink("c:/COM/Sample2.xls");
}
$excel = new COM('Excel.Application') or die('Start Excel automation failed.');
$wbook = $excel->Workbooks->Open("c:/COM/Sample.xls");
$sheet = $wbook->ActiveSheet;
$cells = $sheet->Cells;
print $cells[3][2];echo "\n";
$cells[3][2] = "999999";
print $cells[3][2];echo "\n";
$wbook->Close(true, "c:/COM/Sample2.xls");
$excel = null;
echo "Test passed\n";
?>
This both reads and writes a multi-dimension array with no problems which suggests to me the problem
has either been fixed in PHP in the
interim or its not a simple case of COM array assignment not working.
Also, the error message you get
"Error [0x8002000f] Parameter not optional"
suggests something specific to the property you are trying to modify.
If you still have a problem with latest snapshot is there anyway you can provide a standalone
testcase so I can recreate the issue locally.
Regards
Andy
------------------------------------------------------------------------
[2007-02-10 04:31:38] lee at dark-circuit dot com
sorry, messed up expected result slightly. Should be:
Expected result:
----------------
CAKE
PIE
PIE
------------------------------------------------------------------------
[2007-02-10 00:36:05] lee at dark-circuit dot com
Description:
------------
Fatal error when setting the value of COM object's property array
Basically I'm having the same problem as Bug #28161 [This bug is marked closed, fixed]
http://bugs.php.net/bug.php?id=28161&edit=1
COM Array Assignment isn't working.
In the old closed bug, wez posted a fix that went into RC2 of PHP 5.0, but I'm guessing that
the fix didn't make it into release 5.0 or any current versions. Have tested code on most
currentish snaps of PHP 5.0 - 5.2.2 for sanity.
Reproduce code:
---------------
$itemindex = 2914;
$oInfo = new COM("PAW.LineItem") or die("WHAT THE?");
$oInfo->GetForIndex($itemindex);
// CustomField is:
// string CustomField(ByVal Index As Integer)
echo $oInfo->CustomField[1];
echo "\n";
$oInfo->CustomField[1] = "PIE";
echo "\n";
echo $oInfo->CustomField[1];
Expected result:
----------------
CAKE
PIE
CAKE
Actual result:
--------------
CAKE
PHP Fatal error: Uncaught exception 'com_exception' with message
'Error [0x8002000f] Parameter not optional.
' in C:\New Folder\prime-sync-itemdb.php:197
Stack trace:
#0 C:\New Folder (3)\prime-sync-itemdb.php(197): unknown()
#1 {main}
thrown in C:\New Folder\prime-sync-itemdb.php on line 197
Note: for sanity I confirmed assignment works to same property by writing same program in VB.NET.
Works ok.
oInfo.CustomField(1) = "PIE" in VB.NET
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=40424&edit=1