Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Slide deck generation fails with TypeError when the model omits "content"; slides always in English

Open Beginner friendly
#6,120 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start in lib/Service/SlideDeckService.php, reading PROMPT and parseModelJSON() around line 142. Check the handling of missing title, subtitle, and content fields, then verify that malformed model output no longer causes a TypeError and that the prompt requests the presentation’s language for all slide text.

Written by the indexing model from the issue text.

Description

Version: richdocuments 12.0.0 · Nextcloud 35

Actual (log):
TitleContentSlide::__construct(): Argument #3 ($content) must be of type array|string, null given, called in lib/Service/SlideDeckService.php on line 142

Cause

  1. parseModelJSON() passes $slideJSON['content'] without checking it exists. Small local models sometimes return a layout: 1 slide with
    subtitle instead of content (observed with a ~4B model; a larger model returned valid JSON for the same prompt) → the whole task fails.
  2. SlideDeckService::PROMPT has no instruction about output language (the text/spreadsheet prompts do: "in the same language as the description"),
    so slides come out in English for non-English requests (observed for Thai with both a small and a large model).

Fix (tested): null-coalesce title/subtitle/content (fall back to subtitle for content), and add
"Write all slide texts in the same language as the presentation text." to the prompt. Patch below.

Patch (tested on a test instance):

--- a/lib/Service/SlideDeckService.php
+++ b/lib/Service/SlideDeckService.php
@@ -64,6 +64,8 @@
 
 Only output the JSON array. Do not wrap it with spaces, new lines or backticks (`).
 
+Write all slide texts in the same language as the presentation text.
+
 Here is the presentation text:
 EOF;
 
@@ -137,9 +139,9 @@
 			$slideLayout = LayoutType::from($layoutTypes[$slideJSON['layout']]);
 
 			$slide = match ($slideLayout) {
-				LayoutType::Title => new TitleSlide($index, $slideJSON['title'], $slideJSON['subtitle']),
+				LayoutType::Title => new TitleSlide($index, $slideJSON['title'] ?? '', $slideJSON['subtitle'] ?? ''),
 
-				LayoutType::TitleContent => new TitleContentSlide($index, $slideJSON['title'], $slideJSON['content']),
+				LayoutType::TitleContent => new TitleContentSlide($index, $slideJSON['title'] ?? '', $slideJSON['content'] ?? $slideJSON['subtitle'] ?? ''),
 
 				default => null,
 			};
Dominant language
JavaScript
Stars
453
Forks
147
Avg merge
18h 31m
Merged PRs (30d)
86

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/richdocuments

All issues in nextcloud/richdocuments

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.