Outlook Integration 1.7.1: Calendar sync throws TypeError (ExternalAccount null)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • christb
    Junior Member
    • Mar 2026
    • 2

    #1

    Outlook Integration 1.7.1: Calendar sync throws TypeError (ExternalAccount null)

    Extension version: Outlook Integration 1.7.0 and 1.7.1 (confirmed identical code in the affected files between these two versions)
    EspoCRM version: 9.3.8
    PHP version: 8.4.21
    Database: PostgreSQL

    Expected behavior:
    When Services/OutlookCalendar::getExternalAccountForSync() returns null (which it does deliberately for several legitimate cases: no userId on the OutlookCalendarUser, user not found, no ExternalAccount record, account not enabled / outlookCalendarEnabled off, no calendarDirection set, ACL check failing, connection ping failing, or scope check failing), the sync for that user should simply be skipped without an error.

    Actual behavior:
    A TypeError is thrown and logged at ERROR level every time the scheduled job "Sync Outlook Calendar" runs (default every 3 minutes) for any OutlookCalendarUser whose getExternalAccountForSync() returns null:

    ...

    Steps to reproduce:
    1. Install/enable the "Outlook Integration" extension (v1.7.0 or v1.7.1).
    2. For a user, connect Outlook (ExternalAccount with id Outlook__{userId}) and enable calendar sync, selecting a calendar — this creates an active OutlookCalendarUser record.
    3. Put the external account into a state where getExternalAccountForSync() returns null while the OutlookCalendarUser stays active — e.g. disable the connection's "Enabled" toggle, or leave calendarDirection unset, or let the connection check (ping) fail.
    4. Wait for the "Sync Outlook Calendar" scheduled job to run (every 3 minutes by default), or trigger it manually via Administration > Scheduled Jobs.
    5. Check data/logs/espo.log for the current date — the TypeError above appears for this user on every run.
    ...
    Last edited by yuri; 06-19-2026, 08:10 AM.
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9870

    #2
    Thank you for reporting. Will be fixed.

    Comment

    Working...