Bug in v0.11.0
Hello!
There is the following code:
use garethp\ews\API;
use garethp\ews\API\Enumeration\CalendarItemCreateOrDeleteOperationType;
$api = API::withUsernameAndPassword(
'root_server',
'root_login',
'root_pass'
);
$calendar = $api->setPrimarySmtpEmailAddress('[email protected]')->getCalendar();
$createdItemIds = $calendar->createCalendarItems(
[
'Subject' => 'Test',
'Start' => '2025-08-07T10:50:00+03:00',
'End' => '2025-08-07T11:50:00+03:00',
'Location' => 'Room 1',
'RequiredAttendees' => [
'Attendee' => [
[
'Mailbox' => [
'Name' => 'some_user',
'EmailAddress' => '[email protected]',
'RoutingType' => 'SMTP'
]
]
]
]
],
[
'SendMeetingInvitations' => CalendarItemCreateOrDeleteOperationType::SEND_ONLY_TO_ALL,
]
);
I've noticed that the code behaves differently in library versions 0.11.0 and 0.9.6.
In the first case (library version 0.11.0):
- A calendar event is created where the organizer is set as the user with
root_login - One attendee with email
[email protected]is added
In the second case (library version 0.9.6):
- A calendar event is created with only one attendee (email =
[email protected]) - No organizer is specified at all
Additionally, if I don't specify any attendees in the script above, then in the new library version (0.11.0), the calendar event won't be delivered to the user with email [email protected], despite it being specified in setPrimarySmtpEmailAddress.
Essentially, version 0.9.6 worked as expected.
How can these issues be fixed in version 0.11.0?
Additionally If i set
'Organizer' => [
'Mailbox' => [
'Name' => 'some_user',
'EmailAddress' => '[email protected]',
'RoutingType' => 'SMTP'
]
]
this will causes an error
garethp\ews\API\Message\ResponseMessageType::setMessageXml(): Argument #1 ($value) must be of type garethp\ews\API\Message\ResponseMessageType\MessageXmlAType, stdClass given, called in /var/www/vendor_dt/garethp/php-ews/src/API/MagicMethodsTrait.php on line 22 (0)
/var/www/vendor_dt/garethp/php-ews/src/API/Message/ResponseMessageType.php:135
#0: garethp\ews\API\Message\ResponseMessageType->setMessageXml
/var/www/vendor_dt/garethp/php-ews/src/API/MagicMethodsTrait.php:22
...
@kambereBr Any thoughts?
@angerro Thanks for reporting this. I’ll try to reproduce it on my side and work on a fix.
I think I managed to track down what was going on. Can you try this against master?
I think I managed to track down what was going on. Can you try this against
master?
Thank you very much for your answer! I will try to reproduce the error again in about 12 hours. It's already night time here now :-)
@Garethp I think we can close this issue