Upgrade to Nextcloud 32
General
A new
tests/autoload.phpfile was added to server repository, that you can include in your appbootstrap.phpfile for tests, to be able to load the core\Test\TestCaseclass. You should remove any call to\OC::$loaderin your code as this legacy loader is being removed. This new file is backported to branches stable31, stable30 and stable29, so if your application supports multiple Nextcloud major versions it should still work.
Front-end changes
Added APIs
TBD
Changed APIs
TBD
Deprecated APIs
TBD
Removed APIs
TBD
Back-end changes
Added APIs
New task processing task type
OCP\TaskProcessing\TextToSpeechto convert text to speech.New interface
\OCP\Share\IShareProviderSupportsAllSharesInFolderextending\OCP\Share\IShareProviderto add the method\OCP\Share\IShareProviderSupportsAllSharesInFolder::getAllSharesInFolderused for querying all shares in a folder without filtering by user.New method
\OCP\IUser::canChangeEmailallowing to check if the user backend allows the user to change their email address.New method
\OCP\Files\IFilenameValidator::sanitizeFilenameallowing to sanitize a given filename to comply with configured constraints.New service
\OCP\Template\ITemplateManagerto access template related functions, and get instances of new interface\OCP\Template\ITemplateinstead of building manually\OCP\Template.New event
\OCP\Files\Config\Event\UserMountAddedEventwhich is emitted when new mount is added to theoc_mountstable.New event
\OCP\Files\Config\Event\UserMountRemovedEventwhich is emitted when an existing mount is removed from theoc_mountstable.New event
\OCP\Files\Config\Event\UserMountUpdatedEventwhich is emitted when an existing mount is updated in theoc_mountstable.New attribute
\OCP\AppFramework\Http\Attribute\RequestHeaderused for documenting request headers for OpenAPI specifications generated using openapi-extractor.New method
\OCP\Files\Template\ITemplateManager::listTemplateFieldsto allow listing the fields of a template.New method
\OCA\Files\Controller\TemplateController::listTemplateFieldsto list the fields of a template, accessible at/ocs/v2.php/apps/files/api/v1/templates/fields/{fileId}.New method
\OCP\Files\Template\BeforeGetTemplatesEvent::shouldGetFieldsto get the event’swithFieldsproperty, which should determine whether or not to perform template field extraction on the returned templates.
Changed APIs
\OCP\Authentication\TwoFactorAuth\ILoginSetupProvider::getBody,\OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings::getBodyand\OCP\Authentication\TwoFactorAuth\IProvider::getBodyreturn type was broaden from\OCP\Templateclass to\OCP\Template\ITemplateinterface. Should not change anything for applications.\OCP\Files\Template\BeforeGetTemplatesEventnow takes an optional boolean constructor value,withFields, that allows you to explicitly control whether template fields should be extracted. The default value isfalse.
Deprecated APIs
The files API endpoint
/apps/files/api/v1/thumbnail/for generating previews is deprecated. Instead use the preview endpoint provided by Nextcloud core (/core/preview).The legacy method
\OC_Helper::canExecuteis deprecated, please use theOCP\IBinaryFinderinstead.\OC_Templateand\OCP\Templateclasses are deprecated, please use the new\OCP\Template\ITemplateManagerinstead.\OC_User::useBackendis deprecated, please use\OCP\IUserManager::registerBackendavailable since 8.0.0\OC_User::clearBackendsis deprecated, please use\OCP\IUserManager::clearBackendsavailable since 8.0.0\OC_Helper::isReadOnlyConfigEnabledis deprecated, please use theconfig_is_read_onlysystem config directly.
Removed APIs
The
scssphppackage is no longer shipped with Nextcloud. This package was not used and deprecated since Nextcloud 22. If you need the package for your app, then you need to ship it yourself.\OCP\Files::getStorageand the legacyOC_App_::getStoragemethods were deprecated since Nextcloud 14, respective Nextcloud 5, and were now removed. Instead use\OCP\Files\IAppData.\OCP\AppFramework\App::registerRoutes(deprecated in Nextcloud 20) was removed. Instead return the routes as an array from your routes.php or use route attributes.The legacy visibility constants of
OCP\Accounts\IAccountManager,VISIBILITY_PRIVATE,VISIBILITY_CONTACTS_ONLY,VISIBILITY_PUBLIC, were deprecated since Nextcloud 21 and are now removed. Instead only the v2 visibility constants can be used.Removed deprecated methods of legacy
\OC_Helperclass:humanFileSizewas deprecated since version 4.0.0 and replaced with\OCP\Util::humanFileSizecomputerFileSizewas deprecated since version 4.0.0 and replaced with\OCP\Util::computerFileSizemb_array_change_key_casewas deprecated since version 4.5.0 and replaced with\OCP\Util::mb_array_change_key_caserecursiveArraySearchwas deprecated since version 4.5.0 and replaced with\OCP\Util::recursiveArraySearchrmdirrwas deprecated since version 5.0.0 and replaced with\OCP\Files::rmdirrmaxUploadFilesizewas deprecated since version 5.0.0 and replaced with\OCP\Util::maxUploadFilesizefreeSpacewas deprecated since version 7.0.0 and replaced with\OCP\Util::freeSpaceuploadLimitwas deprecated since version 7.0.0 and replaced with\OCP\Util::uploadLimit
Removed deprecated methods of legacy
\OC_Utilclass:addScriptwas replaced by\OCP\Util::addScriptin 24addVendorScriptwas unused and removedaddTranslationswas replace by\OCP\Util::addTranslationsin 24
Template function
vendor_scriptwas unused and removedThe support for
app.phpfiles, deprecated since Nextcloud 19, was removed. Existence of the file is still checked to show an error if present, but that will be removed in a later version. Please move toOCP\AppFramework\Bootstrap\IBoostrapinstead.The following getters, deprecated since 20, were removed. Please use Dependency Injection or
\OCP\Server::getinstead:IServerContainer::getAppConfig()IServerContainer::getAvatarManager()IServerContainer::getCalendarManager()IServerContainer::getCalendarResourceBackendManager()IServerContainer::getCalendarRoomBackendManager()IServerContainer::getCloudFederationFactory()IServerContainer::getCloudFederationProviderManager()IServerContainer::getCommandBus()IServerContainer::getCommentsManager()IServerContainer::getContentSecurityPolicyManager()IServerContainer::getCredentialsManager()IServerContainer::getDateTimeFormatter()IServerContainer::getDateTimeZone()IServerContainer::getEncryptionKeyStorage()IServerContainer::getEventLogger()IServerContainer::getGlobalScaleConfig()IServerContainer::getHTTPClientService()IServerContainer::getIniWrapper()IServerContainer::getLogFactory()IServerContainer::getMountManager()IServerContainer::getMountProviderCollection()IServerContainer::getNavigationManager()IServerContainer::getPreviewManager()IServerContainer::getQueryLogger()IServerContainer::getRemoteApiFactory()IServerContainer::getRemoteInstanceFactory()IServerContainer::getRouter()IServerContainer::getShareManager()IServerContainer::getStorageFactory()IServerContainer::getSystemTagManager()IServerContainer::getSystemTagObjectMapper()IServerContainer::getTagManager()