Upgrade to Nextcloud 31
General
TBD
Front-end changes
Logical position CSS rules
With Nextcloud 31 all server provided styles are migrated to use logical positioning instead of physical, this allows the front-end layout to adjust to different language directions (right-to-left). App developers are strongly encouraged to migrate their apps to logical positioning too.
Examples for logical vs physical positioning:
margin-inline-start: 4px;instead ofmargin-left: 4px;inset-inline-end: 8px;instead ofright: 8px
Files and Files sharing
With Nextcloud 28 the Files app front-end was migrated to Vue and the private API ( OCA.Files ) was removed,
but for public shares the legacy frontend-end was still used. With Nextcloud 31 public shares also use the new Vue front-end.
This means accessing the legacy private API in OCA.Files is no longer possible, all existing apps should migrate to the public API.
To make migration easier utility functions are provided in the @nextcloud/sharing package
to check whether the current Files app instance is a public share or not, and if so to fetch the share token.
import { isPublicShare, getSharingToken } from '@nextcloud/sharing/public'
if (isPublicShare()) {
console.info('This is a public share with the sharing token: ', getSharingToken())
}
Added APIs
TBD
Changed APIs
TBD
Deprecated APIs
TBD
Removed APIs
OCA.FilesSharingDropremoved as part of the Vue migration. Use the Files app API provided by the package .
Back-end changes
Added APIs
It is now possible to download folders as zip or tar archives using the WebDAV backend using
GETrequests. See the relevant endpoint documentation.OCP\SetupCheck\CheckServerResponseTraitwas added to ease implementing custom setup checks which need to check HTTP calls to the the server itself.
Changed APIs
Clarify
OCP\Files\Storage\IStorage::getOwner()returnsstring|false.Added method parameter and return types to all inheritors of
OCP\Files\Storage\IStorage. To migrate in a backwards compatible manner:Add all return types to your implementation now.
Add all parameter types to your implementation once Nextcloud 31 is the lowest supported version.
The Nextcloud implementation of the
logmethod ofPsr\Log\LoggerInterfacenow supportsPsr\Log\LogLevelas log level parameter.The
OCP\DB\QueryBuilder\IQueryBuildernow supports more date / time related parameter types:PARAM_DATE_MUTABLEandPARAM_DATE_IMMUTABLEfor passing a\DateTime(\DateTimeImmutablerespectively) instance when only interested in the date part.PARAM_TIME_MUTABLEandPARAM_TIME_IMMUTABLEto pass a\DateTime(\DateTimeImmutablerespectively) instance when only interested in the time part.PARAM_DATETIME_MUTABLEandPARAM_DATETIME_IMMUTABLEto pass a\DateTime(\DateTimeImmutablerespectively) instance without handling of the timezone.PARAM_DATETIME_TZ_MUTABLEandPARAM_DATETIME_TZ_IMMUTABLEto pass a\DateTime(\DateTimeImmutablerespectively) instance with handling of the timezone.
The
OCP\\DB\\Typesnow support more date and time related types for usage with theEntity:DATE_IMMUTABLEfor fields that will (de)serialized as\DateTimeImmutableinstances with only the date part set.TIME_IMMUTABLEfor fields that will (de)serialized as\DateTimeImmutableinstances with only the time part set.DATETIME_IMMUTABLEfor fields that will (de)serialized as\DateTimeImmutableinstances with both the time part set but without timezone information.DATETIME_TZfor fields that will (de)serialized as\DateTimeinstances with both the time part set and with timezone information.DATETIME_TZ_IMMUTABLEfor fields that will (de)serialized as\DateTimeImmutableinstances with both the time part set and with timezone information.
Deprecated APIs
The
/s/{token}/downloadendpoint for downloading public shares is deprecated. Instead use the Nextcloud provided WebDAV endpoint.OCP\DB\QueryBuilder\IQueryBuilder::PARAM_DATEis deprecated in favor ofPARAM_DATETIME_MUTABLEto make clear that this type also includes the time part of a date time instance.
Removed APIs
Legacy, non functional,
OC_App::getFormswas removed.The private and legacy
OC_Filesclass was removed. Instead useOCP\AppFramework\Http\StreamResponseorOCP\AppFramework\Http\ZipResponse.The private and legacy Ajax endpoint for downloading file archives (
/apps/files/ajax/download.php) was removed. Instead use the Nextcloud provided WebDAV endpoint.- All
OCP\ILoggerlogging methods, deprecated since Nextcloud 20, are removed. The interface now only holds the Nextcloud internal logging level constants. For all logging
Psr\Log\LoggerInterfaceshould be used.The
OCP\ILoggerinterface can no longer be dependency injected as it now only holds constants.OCP\IServerContainer::getLoggerwas removed, use dependency injection withPsr\Log\LoggerInterfaceinstead.
- All
The internal class
OC\AppFramework\Loggerwas removed, it should have been never used by apps. All using apps should migrate toPsr\Log\LoggerInterface.