Skip to content

fix: preserve the default name for localized ExApps - #1215

Open
isboston wants to merge 1 commit into
nextcloud:mainfrom
isboston:codex/fix-exapp-localized-name
Open

isboston wants to merge 1 commit into
nextcloud:mainfrom
isboston:codex/fix-exapp-localized-name

Conversation

@isboston

Copy link
Copy Markdown

Fixes #1175.

Repeated <name> elements are decoded as an array. Resolve the default XML name before AppAPI stores it and sets APP_DISPLAY_NAME.

Tested with app_api:app:update --info-xml … --wait-finish on Nextcloud 36.0.0 dev. The official Python Skeleton container was recreated with a version bump from 3.0.3 to 3.0.4 and localized names in the test metadata, using the same official image. Before the fix, both the registered name and APP_DISPLAY_NAME were Array and the update logged two array-to-string warnings. With the fix, both were App Skeleton Updated and there were no such warnings. The updated ExApp stayed enabled and its heartbeat returned ok.

composer lint, composer cs:check, composer psalm, and composer test:unit passed (496 tests, 6 skipped).

  • AI assistance: Codex drafted the patch and regression tests and assisted with live validation.

Converting info.xml to an array turns repeated name elements into an array. Resolve the default XML name before AppAPI saves it and creates the container environment.

Assisted-by: Codex:gpt-6
Signed-off-by: Vladimir Ischenko <vladimir.ischenko@onlyoffice.com>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When the decoded XML name is an array, getAppInfo selects the first name without a lang attribute or with lang="en". If neither is present, it uses the XML document’s name value. Tests cover an unlocalized name and an English name when a German name appears first.

Severity of issue fixed: Low

Merge Risk: Minimal · up to a86e7

This change keeps the default display name for ExApps that declare localized names, instead of storing "Array". The change is small and covered by tests, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: preserving the default XML name when a localized ExApp declares repeated name elements. The raw summary confirms getAppInfo now picks the default name instead of an ar…
Description check Passed The description states the cause (repeated name elements decode to an array), the fix (resolve the default XML name before AppAPI stores it and sets APP_DISPLAY_NAME), and the test steps and results. …
Linked Issues check Passed Issue #1175 requires that an ExApp with repeated localized <name> elements gets an appropriate display name in the AppAPI registration and in APP_DISPLAY_NAME, without array-to-string warnings. At…
Out of Scope Changes check Passed The changes are the name-resolution fix in lib/Service/ExAppService.php (+4 lines) and its regression test in tests/php/Service/ExAppServiceGetAppInfoTest.php, which adds a data provider and an op…
Full details: Title check

Explanation

The title names the main change: preserving the default XML name when a localized ExApp declares repeated name elements. The raw summary confirms getAppInfo now picks the default name instead of an array. The title is specific and matches the changeset and linked issue #1175.

Full details: Description check

Explanation

The description states the cause (repeated name elements decode to an array), the fix (resolve the default XML name before AppAPI stores it and sets APP_DISPLAY_NAME), and the test steps and results. It relates directly to the changeset.

Full details: Linked Issues check

Explanation

Issue #1175 requires that an ExApp with repeated localized &lt;name&gt; elements gets an appropriate display name in the AppAPI registration and in APP_DISPLAY_NAME, without array-to-string warnings. At the reviewed head, ExAppService::getAppInfo() handles the XML path. When $appInfo['name'] is an array, it selects the first &lt;name&gt; element with no lang attribute or with lang="en" through the XPath name[not(@lang) or @lang="en"]. If no such element exists, it falls back to (string)$xmlAppInfo-&gt;name. The string name then reaches registerExApp(), updateExAppInfo(), and the deploy parameters, so the array no longer reaches the setter or the string cast. The summary also reports a data-provider regression test in ExAppServiceGetAppInfoTest for a German localized name placed before an unlocalized or en name. The PR reports live validation on Nextcloud 36.0.0 dev: both values became App Skeleton Updated, with no warnings, and the ExApp stayed enabled. The issue's Findling 1.6.0 metadata has the same shape (default plus de and fr names), so the fix covers that case. The changed file was readable at head. The whole-PR diff was not readable because changed blobs were missing, so the test file content was not checked directly.

Full details: Out of Scope Changes check

Explanation

The changes are the name-resolution fix in lib/Service/ExAppService.php (+4 lines) and its regression test in tests/php/Service/ExAppServiceGetAppInfoTest.php, which adds a data provider and an optional name-element parameter to the XML fixture helper. Both directly implement the objective of #1175. The PR description contains no unrelated changes. The whole-PR diff could not be read, so this verdict relies on the summary and on the readable head file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53661662-9c2b-4b76-be8d-0c235b30c64d
Commits

Reviewing files that changed from the base of the PR and between 634729d and a86e79a.

Files selected for processing: 2

  • lib/Service/ExAppService.php
  • tests/php/Service/ExAppServiceGetAppInfoTest.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Copy link
Copy Markdown
Author

Could a maintainer approve the pending GitHub Actions runs for this PR? Thanks!

Assisted by Codex:gpt-6

@isboston

Copy link
Copy Markdown
Author

Thanks for approving the CI run. NC_Py_API · MySQL and APCu · NC_Py_API · MySQL both stop during dependency setup. The logs show that nc-py-api requires Python 3.11 or later, while those jobs use Python 3.10.22.

This appears to be the CI setup issue addressed by #1211. Its test run passed with the Python update. Once #1211 lands, I can update this branch and check the MySQL jobs again.

Assisted by Codex.

This branch has not been deployed

No deployments
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.

Localized ExApp names are stored as Array during update

1 participant