Skip to content

docs(config): replace deprecated IConfig app/user value examples#14964

Open
skjnldsv wants to merge 2 commits into
masterfrom
fix/appconfig-iconfig-deprecated-docs
Open

docs(config): replace deprecated IConfig app/user value examples#14964
skjnldsv wants to merge 2 commits into
masterfrom
fix/appconfig-iconfig-deprecated-docs

Conversation

@skjnldsv
Copy link
Copy Markdown
Member

☑️ Resolves

Summary

basics/storage/configuration.rst showed IConfig::getAppValue/setAppValue and
IConfig::getUserValue/setUserValue as the recommended approach. Both are deprecated.

Changes:

  • App values section: replaced with OCP\AppFramework\Services\IAppConfig (deprecated since NC29). Added typed getter/setter example and cross-ref to the full appconfig.rst reference.
  • User values section: replaced with \OCP\Config\IUserConfig (deprecated since NC31). Added typed getter/setter example and cross-ref to the full userconfig.rst reference.
  • System values section: unchanged — IConfig is still the correct interface there.
  • Dropped the outdated manual service registration boilerplate from the intro.

Needs backports to stable30 and stable29 per maintainer comment on the issue.

🖼️ Screenshots

✅ Checklist

  • I have built the documentation locally and reviewed the output
  • Screenshots are included for visual changes
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

Replaces IConfig::getAppValue/setAppValue with OCP\AppFramework\Services\IAppConfig
(deprecated since NC29) and IConfig::getUserValue/setUserValue with
OCP\Config\IUserConfig (deprecated since NC31).

System values section unchanged — IConfig is still correct there.

Fixes #12221

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Remove duplicate /developer_manual/ prefix from :doc: paths — Sphinx
source root for the developer manual is developer_manual/ itself, so
the absolute paths must start with /digging_deeper/, not
/developer_manual/digging_deeper/.

Fixes CI warnings:
  WARNING: unknown document: '/developer_manual/digging_deeper/config/appconfig'
  WARNING: unknown document: '/developer_manual/digging_deeper/config/userconfig'

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@ChristophWurst ChristophWurst removed their request for review May 20, 2026 08:43
@github-actions
Copy link
Copy Markdown
Contributor

📖 Documentation Preview

🔍 Open preview →

📄 1 changed documentation page

Last updated: Wed, 20 May 2026 09:58:02 GMT

@@ -50,19 +25,15 @@ System values are saved in the :file:`config/config.php` and allow the app to mo
use OCP\IConfig;

class AuthorService {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code example is very terrible, we should have something more meaningful here.


System values are saved in the :file:`config/config.php` and allow the app to modify and read the global configuration. Please note that ``setSystemValue`` might throw a ``OCP\HintException`` when the config file is read-only.
System values are saved in :file:`config/config.php`. Inject ``\OCP\IConfig``
and use the ``getSystemValue*`` / ``setSystemValue`` methods.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should mention all the getter methods for specific types. Even better only mentioned the typed methods.

Comment on lines +45 to +48
.. note::

Use ``getSystemValueBool()``, ``getSystemValueString()``, and ``getSystemValueInt()``
for typed return values.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it should not be a note down here.

use OCP\IConfig;
use OCP\AppFramework\Services\IAppConfig;

class AuthorService {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code example is better, maybe just copy this to the system config example above.

@skjnldsv skjnldsv self-assigned this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppConfig is not recommended everywhere

2 participants