From 1e02ee68e5baebaa2596e163f3843f33281ad2e3 Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Mon, 20 Mar 2023 16:53:50 +0200 Subject: [PATCH 1/4] Added Nextcloud 26 upgrade changes docs Signed-off-by: Andrey Borysenko --- .../app_upgrade_guide/upgrade_to_26.rst | 59 ++++++++++++++++++- developer_manual/basics/middlewares.rst | 2 + 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst index 58f98dd6db6..eeccec6a7df 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst @@ -33,10 +33,22 @@ Removed APIs ^^^^^^^^^^^^ * :code:`OC.addTranslations` was deprecated since Nextcloud 17 and is now removed. +* The "app icons" background (https://github.com/nextcloud/server/blob/stable25/core/img/background.png and https://github.com/nextcloud/server/blob/stable25/core/img/background.svg) is not used anymore and will be removed (was only used on login page, where we now use the "clouds" background). +* **Bootstrap removed**: The shipped bootstrap was only used for tooltips since ages but shipped and therefore available globally. Because the version we shipped is now EOL, we decided to remove it instead of bringing in a breaking update. For any tootltip it is recommended to just switch to the native :code:`title=` HTML attribute. Back-end changes ---------------- +PHP7.4 +^^^^^^ + +In this release support for PHP7.4 was dropped. Make sure your app compatible with PHP8.0 or higher. + +PHP8.2 +^^^^^^ + +In this release support for PHP8.2 was added. See release notes from PHP about new deprecations. + Migration from PHPDoc annotations to native PHP attributes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -57,9 +69,52 @@ App container parameters with pascal case names ``AppName``, ``UserId`` and ``We Changed APIs ^^^^^^^^^^^^ -tbd +* ``OCP\Files\SimpleFS\ISimpleFile::getSize()`` may now return a float (to support sizes >2G on 32bit systems) +* ``OCP\Files\SimpleFS\InMemoryFile::getSize()`` may now return a float (to support sizes >2G on 32bit systems) +* It is not required anymore to call ``setParsedSubject`` and ``setParsedMessage`` on notifications and activity events when setRichSubject and setRichMessage are used a parsed version is computed automatically. +* Moved ``ICreateFromString::handleIMipMessage(string $name, string $calendarData): void;`` to its own Interface ``IHandleImipMessage`` +* Signatures of methods of ``OCP\AppFramework\Db\Entity`` changed as follows: + * ``public static function fromParams(array $params) -> public static function fromParams(array $params): static`` + * ``public static function fromRow(array $row) -> public static function fromRow(array $row): static`` + * ``protected function setter($name, $args) -> protected function setter(string $name, array $args): void`` + * ``protected function getter($name) -> protected function getter(string $name): mixed`` + * ``protected function markFieldUpdated($attribute) -> protected function markFieldUpdated(string $attribute): void`` +* Middlewares can be registered globally (see :ref:`global_middlewares`) +* It is not required anymore to call ``setParsedSubject`` and ``setParsedMessage`` on notifications and activity events when ``setRichSubject`` and ``setRichMessage`` are used a parsed version is computed automatically. Removed APIs ^^^^^^^^^^^^ -tbd \ No newline at end of file +* ``OCP\BackgroundJob\IJobList::getAll`` method was removed +* 3rdparty dependency ``php-ds/php-ds`` was removed +* ``OCP\Contacts\IManager::getAddressBooks`` method was removed +* ``OCP\Util`` loglevel constants were removed +* 3rdparty dependency ``nikic/php-parser`` was removed + + +Added APIs +^^^^^^^^^^ + +* New ``OCP\Authentication\Token\IProvider`` for authentication providers: Created a new public interface ``OCP\Authentication\Token\IProvider`` with a method invalidateTokensOfUser to invalidate all tokens of a specific user. ``OC\Authentication\Token\Manager`` implements ``OCP\Authentication\Token\IProvider``. +* ``Auto-Submitted`` header for emails: There now is a new method on the ``OCP\Mail\IMessage`` interface ``IMessage::setAutoSubmitted()``. With this method you can specify that an email was an automatic email or response, to allow mail servers to better detect if an out-of-office reply should be sent, better store/filter the emails and so on. Possible values are documented in the ``OCP\Mail\Headers\AutoSubmitted`` interface. +* ``OCP\BackgroundJob\IJobList::getJobsIterator`` method was added +* New ``OCP\BeforeSabrePubliclyLoadedEvent`` event dispatched on public webdav endpoints (it can be used just like ``OCP\SabrePluginEvent`` to inject additional Sabre plugins in apps for example) + +Deprecated +---------- + +* Deprecated ``OCP\AppFramework\Db\Mapper`` was removed. You can easily migrate to ``OCP\AppFramework\Db\QBMapper``, which is doing the same thing using the query builder instead of string based queries. +* ``OCP\BackgroundJob\IJobList::getJobs`` method was deprecated +* Controller action annotation ``@UseSession`` is deprecated. Use new ``UseSession`` attribute instead +* Deprecated classes of ``OCP\Dashboard`` were removed +* **Notifications jQuery event deprecated**: The ``OCA.Notification.Action`` event of the notifications app is deprecated in favor of a ``notifications:action:executed`` event-bus event with + +Changes for admins +------------------ + +* PHP 7.4 is not supported anymore. Please upgrade to PHP 8.0 or higher. +* PHP 8.2 is now supported. +* The recommended webserver configuration has changed to no longer include a default redirect to the login page + * For Apache this change will automatically come with the ``.htaccess`` file provided by the release + * for nginx administrators should ensure that their config is up to date with the `documentation `_ + * The relevant lines to remove are ``error_page 403 /core/templates/403.php;`` and ``error_page 404 /core/templates/404.php;`` diff --git a/developer_manual/basics/middlewares.rst b/developer_manual/basics/middlewares.rst index 106337fce4a..6df5e09b9b8 100644 --- a/developer_manual/basics/middlewares.rst +++ b/developer_manual/basics/middlewares.rst @@ -66,6 +66,8 @@ The middleware can be registered in the app's ``Application`` class: } +.. _global_middlewares: + Global Middlewares ------------------ From c82b09cda434b0c18f5233f02009dde098760d29 Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Mon, 20 Mar 2023 19:28:04 +0200 Subject: [PATCH 2/4] Added links Signed-off-by: Andrey Borysenko --- .../app_upgrade_guide/upgrade_to_26.rst | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst index eeccec6a7df..cd12db4ecd5 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst @@ -34,7 +34,7 @@ Removed APIs * :code:`OC.addTranslations` was deprecated since Nextcloud 17 and is now removed. * The "app icons" background (https://github.com/nextcloud/server/blob/stable25/core/img/background.png and https://github.com/nextcloud/server/blob/stable25/core/img/background.svg) is not used anymore and will be removed (was only used on login page, where we now use the "clouds" background). -* **Bootstrap removed**: The shipped bootstrap was only used for tooltips since ages but shipped and therefore available globally. Because the version we shipped is now EOL, we decided to remove it instead of bringing in a breaking update. For any tootltip it is recommended to just switch to the native :code:`title=` HTML attribute. +* **Bootstrap removed**: The shipped bootstrap was only used for tooltips since ages but shipped and therefore available globally. Because the version we shipped is now EOL, we decided to remove it instead of bringing in a breaking update. For any tootltip it is recommended to just switch to the native :code:`title=` HTML attribute. (`PR#36434 `_ by `nickvergessen `_) Back-end changes ---------------- @@ -71,43 +71,42 @@ Changed APIs * ``OCP\Files\SimpleFS\ISimpleFile::getSize()`` may now return a float (to support sizes >2G on 32bit systems) * ``OCP\Files\SimpleFS\InMemoryFile::getSize()`` may now return a float (to support sizes >2G on 32bit systems) -* It is not required anymore to call ``setParsedSubject`` and ``setParsedMessage`` on notifications and activity events when setRichSubject and setRichMessage are used a parsed version is computed automatically. -* Moved ``ICreateFromString::handleIMipMessage(string $name, string $calendarData): void;`` to its own Interface ``IHandleImipMessage`` -* Signatures of methods of ``OCP\AppFramework\Db\Entity`` changed as follows: +* It is not required anymore to call ``setParsedSubject`` and ``setParsedMessage`` on notifications and activity events when setRichSubject and setRichMessage are used a parsed version is computed automatically. (`PR#34807 `_) +* Moved ``ICreateFromString::handleIMipMessage(string $name, string $calendarData): void;`` to its own Interface ``IHandleImipMessage`` (`PR#34893 `_ by `miaulalala `_) +* Signatures of methods of ``OCP\AppFramework\Db\Entity`` changed as follows (`ref `_): * ``public static function fromParams(array $params) -> public static function fromParams(array $params): static`` * ``public static function fromRow(array $row) -> public static function fromRow(array $row): static`` * ``protected function setter($name, $args) -> protected function setter(string $name, array $args): void`` * ``protected function getter($name) -> protected function getter(string $name): mixed`` * ``protected function markFieldUpdated($attribute) -> protected function markFieldUpdated(string $attribute): void`` -* Middlewares can be registered globally (see :ref:`global_middlewares`) -* It is not required anymore to call ``setParsedSubject`` and ``setParsedMessage`` on notifications and activity events when ``setRichSubject`` and ``setRichMessage`` are used a parsed version is computed automatically. +* Middlewares can be registered globally (see :ref:`global_middlewares`, `PR#36310 `_) Removed APIs ^^^^^^^^^^^^ -* ``OCP\BackgroundJob\IJobList::getAll`` method was removed -* 3rdparty dependency ``php-ds/php-ds`` was removed -* ``OCP\Contacts\IManager::getAddressBooks`` method was removed -* ``OCP\Util`` loglevel constants were removed -* 3rdparty dependency ``nikic/php-parser`` was removed +* ``OCP\BackgroundJob\IJobList::getAll`` method was removed (`PR#36073 `_) +* 3rdparty dependency ``php-ds/php-ds`` was removed (`PR#36198 `_) +* ``OCP\Contacts\IManager::getAddressBooks`` method was removed (`PR#34329 `_) +* ``OCP\Util`` loglevel constants were removed (`PR#34329 `_) +* 3rdparty dependency ``nikic/php-parser`` was removed (`PR#36393 `_) Added APIs ^^^^^^^^^^ -* New ``OCP\Authentication\Token\IProvider`` for authentication providers: Created a new public interface ``OCP\Authentication\Token\IProvider`` with a method invalidateTokensOfUser to invalidate all tokens of a specific user. ``OC\Authentication\Token\Manager`` implements ``OCP\Authentication\Token\IProvider``. -* ``Auto-Submitted`` header for emails: There now is a new method on the ``OCP\Mail\IMessage`` interface ``IMessage::setAutoSubmitted()``. With this method you can specify that an email was an automatic email or response, to allow mail servers to better detect if an out-of-office reply should be sent, better store/filter the emails and so on. Possible values are documented in the ``OCP\Mail\Headers\AutoSubmitted`` interface. -* ``OCP\BackgroundJob\IJobList::getJobsIterator`` method was added -* New ``OCP\BeforeSabrePubliclyLoadedEvent`` event dispatched on public webdav endpoints (it can be used just like ``OCP\SabrePluginEvent`` to inject additional Sabre plugins in apps for example) +* New ``OCP\Authentication\Token\IProvider`` for authentication providers: Created a new public interface ``OCP\Authentication\Token\IProvider`` with a method invalidateTokensOfUser to invalidate all tokens of a specific user. ``OC\Authentication\Token\Manager`` implements ``OCP\Authentication\Token\IProvider``. (`PR#36033 `_ by `individual-it `_) +* ``Auto-Submitted`` header for emails: There now is a new method on the ``OCP\Mail\IMessage`` interface ``IMessage::setAutoSubmitted()``. With this method you can specify that an email was an automatic email or response, to allow mail servers to better detect if an out-of-office reply should be sent, better store/filter the emails and so on. Possible values are documented in the ``OCP\Mail\Headers\AutoSubmitted`` interface. (`PR#36033 `_ by `bennet0496 `_) +* ``OCP\BackgroundJob\IJobList::getJobsIterator`` method was added (`PR#36073 `_) +* New ``OCP\BeforeSabrePubliclyLoadedEvent`` event dispatched on public webdav endpoints (it can be used just like ``OCP\SabrePluginEvent`` to inject additional Sabre plugins in apps for example) (`PR#35789 `_) Deprecated ---------- -* Deprecated ``OCP\AppFramework\Db\Mapper`` was removed. You can easily migrate to ``OCP\AppFramework\Db\QBMapper``, which is doing the same thing using the query builder instead of string based queries. -* ``OCP\BackgroundJob\IJobList::getJobs`` method was deprecated -* Controller action annotation ``@UseSession`` is deprecated. Use new ``UseSession`` attribute instead -* Deprecated classes of ``OCP\Dashboard`` were removed -* **Notifications jQuery event deprecated**: The ``OCA.Notification.Action`` event of the notifications app is deprecated in favor of a ``notifications:action:executed`` event-bus event with +* Deprecated ``OCP\AppFramework\Db\Mapper`` was removed. You can easily migrate to ``OCP\AppFramework\Db\QBMapper``, which is doing the same thing using the query builder instead of string based queries. (`PR#34490 `_ by `rullzer `_) +* ``OCP\BackgroundJob\IJobList::getJobs`` method was deprecated (`PR#36073 `_) +* Controller action annotation ``@UseSession`` is deprecated. Use new ``UseSession`` attribute instead (`PR#36363 `_) +* Deprecated classes of ``OCP\Dashboard`` were removed (`PR#35966 `_) +* **Notifications jQuery event deprecated**: The ``OCA.Notification.Action`` event of the notifications app is deprecated in favor of a ``notifications:action:executed`` event-bus event with (`PR#728 `_) Changes for admins ------------------ From fff5d747e9b11609e0fc129ced161f7d3f364d9a Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Mon, 20 Mar 2023 21:04:51 +0300 Subject: [PATCH 3/4] Update upgrade_to_26.rst Added missing links(0) Signed-off-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> --- .../app_upgrade_guide/upgrade_to_26.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst index cd12db4ecd5..4ed196de11e 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst @@ -59,7 +59,7 @@ Nextcloud 26 supports PHP8.0 and later. This allows the migration from PHPDoc an Planned removal of PSR-0 class loading ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Nextcloud is still loading classes that follow the long deprecated and replaced :ref:`PSR-0 standard `. Nextcloud 26 is the last version that register a generic PSR-0 class loader. From Nextcloud 27 on apps have to either change class file names to match PSR-4 or ship their own (composer) class loader for PSR-0 files or. +Nextcloud is still loading classes that follow the long deprecated and replaced :ref:`PSR-0 standard `. Nextcloud 26 is the last version that register a generic PSR-0 class loader. From Nextcloud 27 on apps have to either change class file names to match PSR-4 or ship their own (composer) class loader for PSR-0 files or. (`PR#36434 `_ by `nickvergessen `_) Dependency Injection Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -71,7 +71,7 @@ Changed APIs * ``OCP\Files\SimpleFS\ISimpleFile::getSize()`` may now return a float (to support sizes >2G on 32bit systems) * ``OCP\Files\SimpleFS\InMemoryFile::getSize()`` may now return a float (to support sizes >2G on 32bit systems) -* It is not required anymore to call ``setParsedSubject`` and ``setParsedMessage`` on notifications and activity events when setRichSubject and setRichMessage are used a parsed version is computed automatically. (`PR#34807 `_) +* It is not required anymore to call ``setParsedSubject`` and ``setParsedMessage`` on notifications and activity events when setRichSubject and setRichMessage are used a parsed version is computed automatically. (`PR#34807 `_ by `come-nc `_) * Moved ``ICreateFromString::handleIMipMessage(string $name, string $calendarData): void;`` to its own Interface ``IHandleImipMessage`` (`PR#34893 `_ by `miaulalala `_) * Signatures of methods of ``OCP\AppFramework\Db\Entity`` changed as follows (`ref `_): * ``public static function fromParams(array $params) -> public static function fromParams(array $params): static`` From 3bab527d8f2240ff9c9b19405ec01c2bc8b54f9b Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Mon, 20 Mar 2023 20:51:42 +0200 Subject: [PATCH 4/4] Fix links Signed-off-by: Andrey Borysenko --- .../app_upgrade_guide/upgrade_to_26.rst | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst index 4ed196de11e..c6b111d7dd6 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_26.rst @@ -59,7 +59,7 @@ Nextcloud 26 supports PHP8.0 and later. This allows the migration from PHPDoc an Planned removal of PSR-0 class loading ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Nextcloud is still loading classes that follow the long deprecated and replaced :ref:`PSR-0 standard `. Nextcloud 26 is the last version that register a generic PSR-0 class loader. From Nextcloud 27 on apps have to either change class file names to match PSR-4 or ship their own (composer) class loader for PSR-0 files or. (`PR#36434 `_ by `nickvergessen `_) +Nextcloud is still loading classes that follow the long deprecated and replaced :ref:`PSR-0 standard `. Nextcloud 26 is the last version that register a generic PSR-0 class loader. From Nextcloud 27 on apps have to either change class file names to match PSR-4 or ship their own (composer) class loader for PSR-0 files or. (`PR#36434 `_ by `ChristophWurst `_) Dependency Injection Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -79,17 +79,18 @@ Changed APIs * ``protected function setter($name, $args) -> protected function setter(string $name, array $args): void`` * ``protected function getter($name) -> protected function getter(string $name): mixed`` * ``protected function markFieldUpdated($attribute) -> protected function markFieldUpdated(string $attribute): void`` -* Middlewares can be registered globally (see :ref:`global_middlewares`, `PR#36310 `_) +* Middlewares can be registered globally (see :ref:`global_middlewares`, `PR#36310 `_ by `ChristophWurst `_) Removed APIs ^^^^^^^^^^^^ -* ``OCP\BackgroundJob\IJobList::getAll`` method was removed (`PR#36073 `_) -* 3rdparty dependency ``php-ds/php-ds`` was removed (`PR#36198 `_) -* ``OCP\Contacts\IManager::getAddressBooks`` method was removed (`PR#34329 `_) -* ``OCP\Util`` loglevel constants were removed (`PR#34329 `_) -* 3rdparty dependency ``nikic/php-parser`` was removed (`PR#36393 `_) - +* ``OCP\BackgroundJob\IJobList::getAll`` method was removed (`PR#36073 `_ by `come-nc `_) +* 3rdparty dependency ``php-ds/php-ds`` was removed (`PR#36198 `_ by `kesselb `_) +* ``OCP\Contacts\IManager::getAddressBooks`` method was removed (`PR#34329 `_ by `come-nc `_) +* ``OCP\Util`` loglevel constants were removed (`PR#34329 `_ by `come-nc `_) +* 3rdparty dependency ``nikic/php-parser`` was removed (`PR#36393 `_ by `kesselb `_) +* Deprecated ``OCP\AppFramework\Db\Mapper`` was removed. You can easily migrate to ``OCP\AppFramework\Db\QBMapper``, which is doing the same thing using the query builder instead of string based queries. (`PR#34490 `_ by `rullzer `_) +* Deprecated classes of ``OCP\Dashboard`` were removed (`PR#35966 `_ by `juliushaertl `_) Added APIs ^^^^^^^^^^ @@ -102,11 +103,9 @@ Added APIs Deprecated ---------- -* Deprecated ``OCP\AppFramework\Db\Mapper`` was removed. You can easily migrate to ``OCP\AppFramework\Db\QBMapper``, which is doing the same thing using the query builder instead of string based queries. (`PR#34490 `_ by `rullzer `_) * ``OCP\BackgroundJob\IJobList::getJobs`` method was deprecated (`PR#36073 `_) -* Controller action annotation ``@UseSession`` is deprecated. Use new ``UseSession`` attribute instead (`PR#36363 `_) -* Deprecated classes of ``OCP\Dashboard`` were removed (`PR#35966 `_) -* **Notifications jQuery event deprecated**: The ``OCA.Notification.Action`` event of the notifications app is deprecated in favor of a ``notifications:action:executed`` event-bus event with (`PR#728 `_) +* Controller action annotation ``@UseSession`` is deprecated. Use new ``UseSession`` attribute instead (`PR#36363 `_ by `ChristophWurst `_) +* **Notifications jQuery event deprecated**: The ``OCA.Notification.Action`` event of the notifications app is deprecated in favor of a ``notifications:action:executed`` event-bus event with (`PR#728 `_ by `nickvergessen `_) Changes for admins ------------------