Skip to content

Default unknown free_busy values to busy - #6

Open
mmonterroca wants to merge 1 commit into
kolab-roundcube-plugins-mirror:masterfrom
mmonterroca:fix-free-busy-default
Open

Default unknown free_busy values to busy#6
mmonterroca wants to merge 1 commit into
kolab-roundcube-plugins-mirror:masterfrom
mmonterroca:fix-free-busy-default

Conversation

@mmonterroca

Copy link
Copy Markdown

Summary

Default missing or unknown free_busy values to busy when saving events through the database driver.

This prevents iTIP imports/updates from failing when an incoming ICS does not provide a recognized free/busy value.

Observed error

In production, an iTIP update from a Microsoft Teams / Outlook invitation failed with:

DB Error: [1048] Column 'free_busy' cannot be null
POST /?_task=calendar&_framed=1&_action=mailimportitip

The failing SQL attempted to update an existing event with:

`free_busy` = NULL

The MySQL schema defines the column as:

`free_busy` tinyint(1) NOT NULL DEFAULT '0'

Cause

_save_preprocess() maps missing or unrecognized free_busy values to null:

$event['free_busy'] = $this->free_busy_map[$free_busy] ?? null;

That conflicts with the database schema during updates.

Fix

Use busy as the default fallback:

$event['free_busy'] = $this->free_busy_map[$free_busy] ?? $this->free_busy_map['busy'];

For meeting invitations, defaulting to busy is safer than failing the import/update and matches normal calendar behavior when no transparency value is present.

Testing

  • Applied the same one-line patch to a Roundcube 1.6.x / kolab/calendar 3.6.1 production install.
  • Validated syntax there with php -l drivers/database/database_driver.php.
  • Re-ran previously failing Microsoft Teams iTIP updates; they imported/updated successfully.

Note: I could not open a separate issue because issues are disabled on this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant