📋 Description
LibreSign is using deprecated methods from \OCP\IConfig that were deprecated in Nextcloud 33.0.0. The deprecation warning says:
@deprecated 33.0.0 - use {@see IUserConfig} or {@see IAppConfig} directly
These need to be updated to use the new interfaces.
📍 Files that need to be updated
1. lib/Service/AccountService.php
- Line 163:
$this->config->getAppValue('core', 'newUser.sendEmail', 'yes')
- Use
IAppConfig::getValueString() instead
- Lines 265, 273, 287, 301, 315: Multiple
$this->config->getUserValue() calls
- Use
IUserConfig::getUserValue() instead
2. lib/Controller/AccountController.php
- Line 422:
$this->config->setUserValue($user->getUID(), Application::APP_ID, $key, $value)
- Use
IUserConfig::setUserValue() instead
3. lib/Migration/Version12000Date20250517134200.php
- Line 34:
$this->config->getAppValue(Application::APP_ID, 'notify_unsigned_user')
- Use
IAppConfig::getValueString() instead
Note: lib/Service/FolderService.php already uses IAppConfig correctly ✅
✅ What needs to be done
-
Add proper dependency injection:
- Inject
IAppConfig for app-level configuration
- Inject
IUserConfig for user-level configuration
- Keep
IConfig only if needed for system-level config
-
Update each file:
- Add
use OCP\Config\IAppConfig; and/or use OCP\Config\IUserConfig;
- Add the dependencies to the constructor
- Replace deprecated method calls with the new interfaces
-
Update tests to mock the new interfaces
-
Run tests for each changed service:
composer test:unit -- --filter AccountService
composer test:unit -- --filter AccountController
📚 Resources
🎯 Important notes
- Target branch:
main
- Backport: After merging to
main, this should be backported to stable branches >= 33
- Commits: Use Conventional Commits and sign-off (
git commit -s)
- Tests: Always run with
--filter flag (see copilot-instructions.md)
💬 Questions?
Feel free to ask in this issue. Don't forget to ⭐️ star this repository!
This task is suitable for first-time contributors! 🚀
📋 Description
LibreSign is using deprecated methods from
\OCP\IConfigthat were deprecated in Nextcloud 33.0.0. The deprecation warning says:These need to be updated to use the new interfaces.
📍 Files that need to be updated
1.
lib/Service/AccountService.php$this->config->getAppValue('core', 'newUser.sendEmail', 'yes')IAppConfig::getValueString()instead$this->config->getUserValue()callsIUserConfig::getUserValue()instead2.
lib/Controller/AccountController.php$this->config->setUserValue($user->getUID(), Application::APP_ID, $key, $value)IUserConfig::setUserValue()instead3.
lib/Migration/Version12000Date20250517134200.php$this->config->getAppValue(Application::APP_ID, 'notify_unsigned_user')IAppConfig::getValueString()insteadNote:
lib/Service/FolderService.phpalready usesIAppConfigcorrectly ✅✅ What needs to be done
Add proper dependency injection:
IAppConfigfor app-level configurationIUserConfigfor user-level configurationIConfigonly if needed for system-level configUpdate each file:
use OCP\Config\IAppConfig;and/oruse OCP\Config\IUserConfig;Update tests to mock the new interfaces
Run tests for each changed service:
📚 Resources
IConfigis used in other Nextcloud apps for reference🎯 Important notes
mainmain, this should be backported to stable branches >= 33git commit -s)--filterflag (see copilot-instructions.md)💬 Questions?
Feel free to ask in this issue. Don't forget to ⭐️ star this repository!
This task is suitable for first-time contributors! 🚀