See #2999721: [META] Deprecate the legacy include files before Drupal 9

Introduce API to handle maintenance mode using the service instance.
Replace MAINTENANCE_MODE constant calls with appropriate API calls.
Properly deprecate or move the functions from the legacy theme.maintenance.inc file.

  • _drupal_maintenance_theme()
  • template_preprocess_authorize_report()

Issue fork drupal-3058881

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

voleger created an issue. See original summary.

voleger’s picture

voleger’s picture

Title: [META] Deprecate content of theme.maintenance.inc file » Deprecate content of theme.maintenance.inc file

There no issue created before related to those functions. And there 2 functions only. So convert META into the task.

voleger’s picture

StatusFileSize
new21.47 KB

initial patch

voleger’s picture

Status: Active » Needs work

ToDo: Add legacy tests.

voleger’s picture

StatusFileSize
new20.9 KB
new524 bytes

Remove unrelated changes

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

voleger’s picture

Rerolled the patch, added legacy tests.

Status: Needs review » Needs work

The last submitted patch, 9: 3058881-9.patch, failed testing. View results

ridhimaabrol24’s picture

Status: Needs work » Needs review
StatusFileSize
new23.25 KB
new2.2 KB

Trying to fix some test cases!

Status: Needs review » Needs work

The last submitted patch, 11: 3058881-11.patch, failed testing. View results

voleger’s picture

Assigned: Unassigned » voleger
+++ b/core/tests/Drupal/KernelTests/Core/Theme/LegacyMaintenanceThemeTest.php
@@ -0,0 +1,57 @@
+    include_once $this->root . '/core/include/theme.maintenance.inc';

fixed typo
/include/ -> /includes/

And renamed legacy test class name

voleger’s picture

StatusFileSize
new23.23 KB
new4.41 KB

And patches of course)

voleger’s picture

Title: Deprecate content of theme.maintenance.inc file » Update MaintenanceMode service and deprecate legacy API
Assigned: voleger » Unassigned
Issue summary: View changes
Status: Needs work » Needs review

Changed the scope of the task.

Merged service with existing MaintenanceMode class in the Drupal\Core\Site namespace.
Replaced MAINTENANCE_MODE constant calls by the service method calls.
Added methods to handle mode states.

voleger’s picture

StatusFileSize
new65.73 KB
new63.13 KB

And patches here as well

Status: Needs review » Needs work

The last submitted patch, 16: 3058881-15.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

voleger’s picture

Status: Needs work » Needs review
StatusFileSize
new66.08 KB
new1.95 KB

Trying to decrease failed tests.

voleger’s picture

Status: Needs review » Needs work

The last submitted patch, 18: 3058881-18.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

voleger’s picture

Status: Needs work » Needs review
StatusFileSize
new66.39 KB
new6.55 KB
new66.39 KB
new6.55 KB

Add missing DI definition, removed type hints.

Status: Needs review » Needs work

The last submitted patch, 21: 3058881-21.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

alexpott’s picture

+++ b/core/install.php
@@ -6,21 +6,13 @@
-/**
- * Global flag to indicate the site is in installation mode.
- *
- * The constant is defined using define() instead of const so that PHP
- * versions prior to 5.3 can display proper PHP requirements instead of causing
- * a fatal error.
- */
-define('MAINTENANCE_MODE', 'install');
-

The funny thing about this one is that because it is install.php and tests use drupal_install() directly nothing can really depend on this being set to install during install.

Imo that implies to me that we should consider not having an install maintenance mode. Nearly everything is using \Drupal\Core\Installer\InstallerKernel::installationAttempted

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Component: theme system » other

Moving to same component as the parent.

andypost’s picture

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.