Upgrade to Nextcloud 27
Note
Critical changes were collected on GitHub. See the original ticket for links to the pull requests and tickets.
General
info.xml
Make sure your appinfo/info.xml allows for Nextcloud 27.
<dependencies>
<nextcloud min-version="25" max-version="27" />
</dependencies>
Front-end changes
General
With Nextcloud 27 you can also provide module javascript files with the
.mjsfile extension. For backwards compatibility you can provide files with the same name but the.jsfile extension which will be loaded for Nextcloud versions before 27.
Added APIs
A new Files Router API allows you to control the files router service and update views, queries or param without page reload. See Files
Back-end changes
Optimized class loader
This documentation previously recommended using any composer class loader optimization in Replacing Nextcloud’s autoloader. Unfortunately authoritative class maps do not work with the upgrade process of Nextcloud apps. When app code is replaced during an app upgrade, the autoloader has to load new classes as well. Authoritative class loaders don’t do that by design. Use the simple class map optimization only.
Removal of PSR-0 class loader
Nextcloud 27 no longer loads classes in the deprecated PSR-0 naming standard. Update the structure to PSR-4 or ship a custom autoloader.
Added APIs
\OCP\AppFramework\Utility\ITimeFactoryis now a\PSR\Clock\ClockInterfacefollowing the PSR-20 standard. (nextcloud/server#35872)\OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME_LEGACYwas added to keep the provisioning API compatible. (nextcloud/server#36665)A new system config
ratelimit.protection.enabled(boolean, default true) was added to allow developers to disable rate limiting. It is not recommended to disable this on a production/live system. (nextcloud/server#37542)A new OCP API under
\OCP\SpeechToTextwas introduced to allow automatic transcription of media (nextcloud/server#37674)Added a new interface
\OCP\BackgroundJob\IParallelAwareJobthat\OCP\BackgroundJob\Jobnow implements. It can be used to allow specifying that multiple instances of a job should not be run at the same time. Also added\OCP\BackgroundJob\IJobList#hasReservedJob(?string $className = null)method to check the condition (nextcloud/server#37835)New property
$actionLabelhas been added to the\OCP\Files\Template\TemplateFileCreatorclass with a respective setterTemplateFileCreator::setActionLabeland getterTemplateFileCreator::getActionLabel. (nextcloud/server#37929 + nextcloud/server#37955)A new interface
\OCP\Group\Backend\ISearchableGroupBackendwas added for group backends supporting new methodsearchInGroupto search among a group users in an efficient way. (nextcloud/server#32866)\OCP\App\IAppManagerhas the following new methods (nextcloud/server#36591):loadApp(string $app): voidLoad an app, if not already loadedisAppLoaded(string $app): boolCheck if an app is loadedloadApps(array $types = []): boolLoads all apps. If $types is set to non-empty array, only apps of those types will be loaded.isType(string $app, array $types): boolCheck if an app is of a specific type
New method
atomicRetry()as been added to the\OCP\AppFramework\Db\TTransactionaltrait as a wrapper around atomic() to retry database operations after a retryable exception like database deadlocks occurred (nextcloud/server#38030)
Changed APIs
\OCP\UserMigration\ISizeEstimationMigrator::getEstimatedExportSize()now returnsint|floatto support 32-bit systems. (nextcloud/server#38104)\OCP\Files\FileInfo::getOwnerdocumented return type is now nullable, to match what was already returned by the implementation (nextcloud/server#36836)\OCP\Files\File::fopenand\OCP\Files\SimpleFS\ISimpleFile::readdocumented return types are now nullable, to match what was already returned by the implementations (nextcloud/server#36836)\OCP\Files\File::getContentmay now also throw aGenericFileExceptionin cases where it would previously return false (while documented to always return a string, which should now be the case - nextcloud/server#37943).
Deprecated APIs
\OCP\AppFramework\Utility\ITimeFactory::getTime()and\OCP\AppFramework\Utility\ITimeFactory::getDateTime()were deprecated, because the interface is now a\PSR\Clock\ClockInterfacefollowing the PSR-20standard. (nextcloud/server#35872)\OCP\GroupInterface::usersInGroup()is deprecated in favor of newly added\OCP\Group\Backend\ISearchableGroupBackendinterface. (nextcloud/server#32866)In
\OC_App, the following methods are deprecated:isAppLoaded,loadApp,isType. Use the new methods from\OCP\App\IAppManagerinstead (nextcloud/server#36591).
Removed APIs
Intermediate transition event classes
\OCP\WorkflowEngine\IEntityCompatand\OCP\WorkflowEngine\IOperationCompathave been removed as advertised for 2023 (nextcloud/server#37040)
Behavioral changes
\OCP\Files\Cache\CacheEntryRemovedEventwill now be dispatched for all files and folders inside the deleted node. (nextcloud/server#34773)\OCP\AppFramework\Db\IMapperExceptiondoes now implement\Throwable, previously either\OCP\AppFramework\Db\DoesNotExistExceptionor\OCP\AppFramework\Db\MultipleObjectsReturnedExceptionhad to be caught explicitly. (nextcloud/server#37324)
Client APIs
Changed APIs
HTTP request that do not pass the lax and strict cookie check return a HTTP status 412 consistently now. It was HTTP 412 and 503 before depending on the endpoint. (nextcloud/server#37316)
The OCS translation API was extended to return the
fromlanguage attribute so in case no from was given, clients can afterwards show in the UI which language was detected and used for translating. (nextcloud/server#38003)