Skip to content

Fix Missing startTime Metadata Field Exception #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release_9
Choose a base branch
from

Conversation

KeksBombe
Copy link

@KeksBombe KeksBombe commented Aug 1, 2025

Fixed a critical bug where the OpenCast plugin would throw an xoctException with the message "could not find metadata field with id startTime" when uploading content with preview images enabled but timestamp disabled.

Problem
When creating a regular upload event (not scheduled), the startDate and startTime metadata fields are not automatically added to the metadata catalogue. However, the MetadataToXML transformer assumed these fields would always be present, causing the plugin to crash during the upload process.


Fixed a critical bug where the OpenCast plugin would throw an Exception when trying to delete a publication.

Problem
When trying to delete something the HeaderText was not Set.

Stack trace location:

Solution
Modified the MetadataToXML::getXML() method to handle missing startDate and startTime fields gracefully:

Added try-catch blocks around metadata field access
Provides sensible fallback values:
startDate: Current date if field is missing
startTime: 00:00:00 if field is missing
Maintains backward compatibility with existing scheduled events that have these fields
Changes Made
File: src/Util/Transformator/MetadataToXML.php
Added exception handling for missing startDate field (fallback to current date)
Added exception handling for missing startTime field (fallback to 00:00:00)
Added import for xoctException class

@chfsx chfsx self-assigned this Aug 4, 2025
@chfsx chfsx added the ILIAS 9 Issue appears or may only appear on ILIAS 9. label Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ILIAS 9 Issue appears or may only appear on ILIAS 9.
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants