Problem/Motivation

The global variables base_url, base_path and base_root as well as the base_path() function are still used throughout core. Removal of those is tricky, since there is no direct replacement on the Symfony request object for those. The globals in Drupal are always relative to the application directory, while Symfony $request->getBaseUrl() returns the base URL relative to the front controller.

For example when running the installer (hxxp://example.com/drupal/core/install.php), Symfony will report the base URL including the core path, while $base_url will only be up to drupal.

Proposed resolution

Since there is no direct replacement in Symfony, it is necessary to introduce an additional service which is capable of returning the base URL and the base path relative to the application (not the front controller).

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#95 Screenshot from 2023-02-27 11-38-15.png94.43 KBvoleger
#94 Screenshot from 2023-02-27 11-27-54.png189.18 KBvoleger
#81 reroll_diff_2529170-70_2529170-81.txt60.68 KByogeshmpawar
#81 2529170-81.patch67.53 KByogeshmpawar
#78 reroll_diff_2529170-70_2529170-78.txt52.98 KByogeshmpawar
#78 2529170-78.patch67.07 KByogeshmpawar
#70 2529170-70.patch68.65 KBvoleger
#64 2529170_64.patch71.13 KBgaurav.kapoor
#62 2529170_62.patch71.2 KBgaurav.kapoor
#60 2529170_60.patch71.26 KBMile23
#57 remove-2529170-57.patch70.06 KBvprocessor
#50 remove-2529170-50.patch70.11 KBdeepakaryan1988
#41 interdiff-39-41.txt2.82 KBmpdonadio
#41 remove-2529170-41.patch78.96 KBmpdonadio
#39 interdiff-34-39.txt18.2 KBmpdonadio
#39 remove-2529170-39.patch78.31 KBmpdonadio
#34 remove-2529170-34-DEBUG.patch78.58 KBmpdonadio
#34 remove-2529170-34.patch78.04 KBmpdonadio
#30 interdiff.txt552 bytesznerol
#30 remove-2529170-30-DEBUG.patch79.28 KBznerol
#28 remove-2529170-28.patch78.74 KBznerol
#28 interdiff.txt618 bytesznerol
#26 interdiff.txt21.64 KBznerol
#26 remove-2529170-26.patch78.75 KBznerol
#22 interdiff.txt2.37 KBznerol
#22 remove-2529170-22.patch72.69 KBznerol
#20 interdiff.txt3.66 KBznerol
#20 remove-2529170-20.patch70.32 KBznerol
#17 interdiff.txt1.03 KBznerol
#17 remove-2529170-17.patch66.66 KBznerol
#16 interdiff.txt5.17 KBznerol
#16 remove-2529170-16.patch66.65 KBznerol
#12 remove-2529170-12.patch62.32 KBznerol
#12 interdiff.txt2.16 KBznerol
#12 interdiff.txt2.16 KBznerol
#12 remove-2529170-12.patch62.32 KBznerol
#7 remove-2529170-7.patch62.33 KBznerol
#7 interdiff.txt3.06 KBznerol
#5 interdiff.txt1.92 KBznerol
#5 remove-2529170-3.patch64.88 KBznerol
#3 interdiff.txt1.92 KBznerol
#3 remove-2529170-1.patch64.87 KBznerol
#1 remove-2529170-1.patch64.87 KBznerol

Issue fork drupal-2529170

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

znerol’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
64.87 KB

\Drupal\Core\App is probably not the best place to add this, any ideas?

Status: Needs review » Needs work

The last submitted patch, 1: remove-2529170-1.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
64.87 KB
1.92 KB

Status: Needs review » Needs work

The last submitted patch, 3: remove-2529170-1.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
64.88 KB
1.92 KB

Proper patch.

Status: Needs review » Needs work

The last submitted patch, 5: remove-2529170-3.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
3.06 KB
62.33 KB

Fix unit test.

Status: Needs review » Needs work

The last submitted patch, 7: remove-2529170-7.patch, failed testing.

Fabianx’s picture

#1: Drupal\Core\Site might work.

Other idea:

Drupal\Core\Utility

Or just inject as a \SplString from DrupalKernel like app.root.

znerol’s picture

I'm currently struggling with reproducing the failures. I suspect there is something going on with run-tests.sh here. I suspect some issue with SCRIPT_FILENAME (should be absolute and seems to be the same as SCRIPT_NAME).

larowlan’s picture

Are you running from a sub directory locally? bot does

znerol’s picture

Are you running from a sub directory locally? bot does

Yes. I was not able to reproduce the fails in the installer, but a closer look at the others revealed some problems with the patch. E.g. base_path is expected to end with a /

Status: Needs review » Needs work

The last submitted patch, 12: remove-2529170-12.patch, failed testing.

The last submitted patch, 12: remove-2529170-12.patch, failed testing.

dawehner’s picture

-1 to put it into utility, given that its kinda a dumping ground for everything.

I think Site is totally fine, as similar to Settings() it depends on the loaded multi site environment.

+++ b/core/lib/Drupal/Core/App.php
@@ -0,0 +1,130 @@
+  public function getBaseUrl() {
...
+  public function getBasePath() {

We should explain exactly here what which bit is.

znerol’s picture

Fixes the LanguageNegotiationUrlTest and also #2481833: Remove LanguageNegotiationUrl's usage of base_path().

znerol’s picture

Fix MailFormatHelper.

The last submitted patch, 16: remove-2529170-16.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 17: remove-2529170-17.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
70.32 KB
3.66 KB

Fix UrlRewritingTest:

  1. According to the docs base_path() always returns a string which is terminated by a slash. Therefore appending a path separator to the return value is plain wrong. (i.e. tests are wrong in head but they pass nevertheless because file_test_file_url_alter is wrong as well.
  2. In order to properly compute the base path, the new class requires a request populated with appropriate values in SCRIPT_NAME and SCRIPT_FILENAME server superglobal.

Status: Needs review » Needs work

The last submitted patch, 20: remove-2529170-20.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
72.69 KB
2.37 KB

Fix PathProcessorTest.

znerol’s picture

The difference in test results (Installer) between testbot and DCI is interesting. I may have found the culprit: Tests pass for me locally if APCu is disabled and I get the same exceptions (hash salt not defined) when APCu is enabled.

Seems like there is no APCu on DrupalCI?

Status: Needs review » Needs work

The last submitted patch, 22: remove-2529170-22.patch, failed testing.

znerol’s picture

Seems like there is no APCu on DrupalCI?

Oh, there is. I'm really lost now regarding the installer tests and I do not manage to reproduce them neither. Any ideas?

znerol’s picture

Status: Needs work » Needs review
FileSize
78.75 KB
21.64 KB

This was quite a hard because of #2507831: Harden redirect responses to make external URIs opt in (was SA-CORE-2015-002 foward-port) relying on RequestContext::getCompleteUrl().

Status: Needs review » Needs work

The last submitted patch, 26: remove-2529170-26.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
618 bytes
78.74 KB

Status: Needs review » Needs work

The last submitted patch, 28: remove-2529170-28.patch, failed testing.

znerol’s picture

Attempting to understand what is going wrong in testbot by adding debug() to \Drupal\Component\Utility\OpCodeCache.

znerol’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 30: remove-2529170-30-DEBUG.patch, failed testing.

mpdonadio’s picture

Don't we just need a version of \Drupal\Core\Routing\RequestContext that uses the application context and not the current request context, and then inject that where it is needed (mainly the link generator)?

mpdonadio’s picture

Reroll b/c #2521852: Make it possible to use your own exception handler

$ git checkout 3f8677b24589e40793f27ca86e3976137e01d791
$ git apply --index remove-2529170-28.patch
$ git rebase 8.0.x
First, rewinding head to replay your work on top of it...
Applying: remove-2529170-28.patch
Using index info to reconstruct a base tree...
M	core/core.services.yml
M	core/includes/common.inc
M	core/includes/install.core.inc
M	core/includes/install.inc
M	core/includes/theme.inc
M	core/lib/Drupal/Core/DrupalKernel.php
M	core/modules/filter/src/Plugin/Filter/FilterHtml.php
M	core/modules/system/src/Tests/Pager/PagerTest.php
M	core/modules/views/src/Plugin/views/field/FieldPluginBase.php
M	sites/default/default.settings.php
Falling back to patching base and 3-way merge...
Auto-merging sites/default/default.settings.php
Auto-merging core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Auto-merging core/modules/system/src/Tests/Pager/PagerTest.php
Auto-merging core/modules/filter/src/Plugin/Filter/FilterHtml.php
Auto-merging core/lib/Drupal/Core/DrupalKernel.php
CONFLICT (content): Merge conflict in core/lib/Drupal/Core/DrupalKernel.php
Auto-merging core/includes/theme.inc
Auto-merging core/includes/install.inc
Auto-merging core/includes/install.core.inc
Auto-merging core/includes/common.inc
Auto-merging core/core.services.yml
Failed to merge in the changes.
Patch failed at 0001 remove-2529170-28.patch

Just used the hunk from HEAD in the conflict in DrupalKernel::handleException().

mpdonadio’s picture

Status: Needs work » Needs review

Setting status so these can fail properly...

The last submitted patch, 34: remove-2529170-34.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 34: remove-2529170-34-DEBUG.patch, failed testing.

mpdonadio’s picture

Spent some time with this today. The patch is failing because the installer is really broken. Most of the URLs for JS, CSS, etc, have 'core/core' in the paths. *REDACTED*. May look into this later tonight, but may not have time.

mpdonadio’s picture

Status: Needs work » Needs review
FileSize
78.31 KB
18.2 KB

The interactive installer was broken (on my machine at least) because of some screwiness with the script name and symlinks between where Apache had its DOCROOT and where the Drupal installation actually was, which caused App::prepareBasePath() to not work as expected, resulting in general mayhem with paths and requests. Also added a helper to Drupal to get the service so autocomplete in PhpStorm work would, and so I could chase the functions properly... Let's see what this does.

Status: Needs review » Needs work

The last submitted patch, 39: remove-2529170-39.patch, failed testing.

mpdonadio’s picture

Status: Needs work » Needs review
FileSize
78.96 KB
2.82 KB

Today I learned that you can't mock methods used in a constructor.

Methinks this will be green. AppTest works locally now.

I also think this could possibly be elevated to a major, because I suspect that it is the best solution for #2548095: Add option to Url() to force the site base_url to be used.

borisson_’s picture

The patch looks great, this also seems to resolve #2481833: Remove LanguageNegotiationUrl's usage of base_path(), so I closed that issue in favour of this one. I think issue credit might need to be copied over from there though.

Fabianx’s picture

+++ b/core/lib/Drupal/Core/App.php
@@ -0,0 +1,142 @@
+  protected function prepareBasePath() {
+    $this->basePath = $this->request->getBasePath();
...
+      if ($script_subdir) {
+        // Base path is request basePath - script subdir
+        $this->basePath = substr($this->request->getBasePath(), 0, -strlen($script_subdir));
+      }

Apologies if this has been asked already:

Why is this necessary?

I thought Symfony had similar logic already in the request object.

znerol’s picture

#43 That's what I tried to explain in the issue summary. Symfonys Request::getBaseX() is relative to the front controller (i.e., it delivers different results for base-path/index.php and base-path/core/install.php). That is a problem because Drupal assumes that the base path is relative to the application, not relative to the front controller.

hussainweb’s picture

Issue tags: +Needs beta evaluation

It seems this could be very disruptive at this stage.

Status: Needs review » Needs work

The last submitted patch, 41: remove-2529170-41.patch, failed testing.

mpdonadio’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue tags: -Needs beta evaluation +Needs reroll

Tried a quick rebase, and there are lots of conflicts here.

deepakaryan1988’s picture

Assigned: Unassigned » deepakaryan1988
Status: Needs work » Active

Working on this!

deepakaryan1988’s picture

-      'request_uri' => $base_root . \Drupal::request()->getRequestUri(),
-      'referer'     => \Drupal::request()->server->get('HTTP_REFERER'),
+      'request_uri' => 'http://example.com/some/location',
+      'referer'     => 'http://example.com/previous/location',

In previous comment, why the above lines has been replaced, I don't understand this, Can someone please help me with this.
As far as I am building new re-rolled patch, I am not including above changed lines.

deepakaryan1988’s picture

Assigned: deepakaryan1988 » Unassigned
Status: Active » Needs review
FileSize
70.11 KB

After lots of issues, rerolled #41 patch.
Let's hope it will pass the QA test.

Status: Needs review » Needs work

The last submitted patch, 50: remove-2529170-50.patch, failed testing.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

pwolanin’s picture

Since we are already extending the request context, can we just put the logic there?

Wim Leers’s picture

vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

Assigned: vprocessor » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
70.06 KB

rerolled

Status: Needs review » Needs work

The last submitted patch, 57: remove-2529170-57.patch, failed testing.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Mile23’s picture

Status: Needs work » Needs review
FileSize
71.26 KB

Reroll.

DrupalKernel still has my favorite: DrupalKernel::guessApplicationRoot(), which should be the job of the app service.

Status: Needs review » Needs work

The last submitted patch, 60: 2529170_60.patch, failed testing.

gaurav.kapoor’s picture

Status: Needs work » Needs review
FileSize
71.2 KB

Fixed the PHP error introduced in last patch.

Status: Needs review » Needs work

The last submitted patch, 62: 2529170_62.patch, failed testing. View results

gaurav.kapoor’s picture

Status: Needs work » Needs review
FileSize
71.13 KB

Status: Needs review » Needs work

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

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

voleger’s picture

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.

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.

larowlan’s picture

Tagging with Bug Smash Initiative because this blocks a bug

yogeshmpawar’s picture

Assigned: Unassigned » yogeshmpawar

Picking it now.

yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
67.07 KB
52.98 KB

Updated patch with reroll diff added.

voleger’s picture

Status: Needs review » Needs work

Please fix PHPCS issues

yogeshmpawar’s picture

Assigned: Unassigned » yogeshmpawar

yes working on it.

yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
Status: Needs work » Needs review
FileSize
67.53 KB
60.68 KB

Fixed PHPCS issues & hiding #78 patch. Added reroll diff against #70.

daffie’s picture

  1. +++ b/core/core.services.yml
    @@ -725,6 +725,9 @@ services:
    +    arguments: ['@app.root']
    

    This should be changed to using the container parameter "app.root". The code should become like: arguments: ['%app.root%'].

  2. +++ b/core/includes/theme.inc
    @@ -1421,7 +1421,7 @@ function template_preprocess_page(&$variables) {
    -  $variables['base_path'] = base_path();
    +  $variables['base_path'] = \Drupal::app()->getBasePath() . '/';
    

    We are not deprecation the function base_path() in this issue. Therefor replacing the function is out of scope for this issue and should not be done in this issue. This is done multiple times in this patch, please remove them all unless we meed to change it anyway for this patch. A followup issue for this should be created.

  3. +++ b/core/lib/Drupal/Core/App.php
    @@ -0,0 +1,138 @@
    +    if ($request != $this->request) {
    

    I do not think that this check is necessary. The only thing it that $this->baseUrl and $this->basePath are recalculated.

  4. +++ b/core/lib/Drupal/Core/DrupalKernel.php
    @@ -940,6 +946,12 @@ protected function initializeContainer() {
    +      if ($request = $request_stack->getMasterRequest()) {
    

    The use of getMasterRerquest() is deprecated. Please use getMainRequest().

  5. +++ b/core/tests/Drupal/Tests/Core/AppTest.php
    @@ -0,0 +1,171 @@
    +    $app = $this->getMock('Drupal\Core\App', ['realpath'], [$root]);
    ...
    +    $app = $this->getMock('Drupal\Core\App', ['realpath'], [$root]);
    

    Could we change these lines to:

        $app = $this->getMockBuilder('Drupal\Core\App')
          ->setConstructorArgs([$root])
          ->onlyMethods(['realpath'])
          ->getMock();
    

    As this is the way we are doing it in Drupal core. Doing the same way improves readability.

  6. +++ b/core/tests/Drupal/Tests/Core/AppTest.php
    @@ -0,0 +1,171 @@
    +    $app->expects($this->any())
    +      ->method('realpath')
    +      ->will($this->returnCallback(function ($path) {
    +        return $path;
    +      }));
    

    This only works because we are testing with paths that do not have /./, /../ and extra / characters. I am not sure we should add testing for that.

  7. +++ b/core/lib/Drupal/Core/DrupalKernel.php
    @@ -1074,46 +1086,6 @@ protected function initializeSettings(Request $request) {
    -    // For a request URI of '/index.php/foo', $_SERVER['SCRIPT_NAME'] is
    -    // '/index.php', whereas $_SERVER['PHP_SELF'] is '/index.php/foo'.
    

    We do not have testing for this in Drupal\Tests\Core\AppTest. Please add testing for this.

  8. +++ b/core/lib/Drupal/Core/DrupalKernel.php
    @@ -1074,46 +1086,6 @@ protected function initializeSettings(Request $request) {
    -    $base_secure_url = str_replace('http://', 'https://', $base_url);
    -    $base_insecure_url = str_replace('https://', 'http://', $base_url);
    

    Contrib or custom code that is relying on these globals to be set will fail when this patch is committed.

  9. +++ b/core/lib/Drupal/Core/DrupalKernel.php
    @@ -589,8 +589,14 @@ public function preHandle(Request $request) {
    +    $GLOBALS['base_url'] = $app->getBaseUrl();
    +    $GLOBALS['base_path'] = $app->getBasePath() . '/';
    +    $GLOBALS['base_root'] = $request->getSchemeAndHttpHost();
    

    We need to add a comment that this lines are a BC layer that will be removed in Drupal 11 with a link to the be created "change record".

  10. +++ b/core/lib/Drupal/Core/DrupalKernel.php
    @@ -940,6 +946,12 @@ protected function initializeContainer() {
    +    if (($request_stack = $this->container->get('request_stack', ContainerInterface::NULL_ON_INVALID_REFERENCE))) {
    

    Nitpick: Why double "(("? A single one should be enough.

  11. +++ b/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php
    @@ -25,17 +25,24 @@ class RedirectResponseSubscriber implements EventSubscriberInterface {
    -  public function __construct(UnroutedUrlAssemblerInterface $url_assembler, RequestContext $request_context) {
    +  public function __construct(UnroutedUrlAssemblerInterface $url_assembler, App $app) {
    

    We cannot make this change. If contrib or custom code call this class with the second parameter being the RequestContext a deprecation warning should be trigger. With the change as it now is the code will fail. Please remove the parameter typehint and add a if-statement testing for the instance type. If RequestContext the throw a deprecation warning and the parameter to the correct value.

  12. +++ b/core/lib/Drupal/Core/Routing/LocalAwareRedirectResponseTrait.php
    @@ -27,32 +27,32 @@ trait LocalAwareRedirectResponseTrait {
    -  public function setRequestContext(RequestContext $request_context) {
    

    This is a public method. We cannot just remove it. It needs to be deprecated and when it is used by contrib or custom it should still work. A deprecation warning should be given.

  13. +++ b/core/lib/Drupal/Core/Routing/RequestContext.php
    @@ -28,37 +20,4 @@ public function fromRequestStack(RequestStack $request_stack) {
    -  public function fromRequest(Request $request) {
    ...
    -  public function getCompleteBaseUrl() {
    ...
    -  public function setCompleteBaseUrl($complete_base_url) {
    

    These 3 public method cannot just be remove, they need to be properly deprecated.

  14. +++ b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
    @@ -80,7 +95,7 @@ public function testPathPrefix($prefix, $prefixes, $expected_langcode) {
    -    $method = new LanguageNegotiationUrl();
    +    $method = new LanguageNegotiationUrl($this->app);
    
    @@ -169,7 +184,7 @@ public function testDomain($http_host, $domains, $expected_langcode) {
    -    $method = new LanguageNegotiationUrl();
    +    $method = new LanguageNegotiationUrl($this->app);
    

    We have added a create method to the class, therefor these changes should not be necessary.

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.

voleger’s picture

Status: Needs work » Needs review

Rerolled against 10.1.x

daffie’s picture

Status: Needs review » Needs work
andypost’s picture

MR meeds rebase

voleger’s picture

Assigned: Unassigned » voleger
joseph.olstad’s picture

Tried rebase via the merge request GUI, it fails. Feb 23 status looks green from the above comment description but I don't see the job, not sure where to find it.

andypost’s picture

Status: Needs work » Needs review

Changed properties and fixed last usage, token changes looks like needs discussion

daffie’s picture

Status: Needs review » Needs work

The testbot is not happy

VladimirAus made their first commit to this issue’s fork.

voleger’s picture

Assigned: voleger » Unassigned
FileSize
189.18 KB

The issue appears on the Drupal\Tests\Core\Command\QuickStartTest run. It probably blocks the rest of the functional tests.
Any idea what is the cause of that behavior?

voleger’s picture

andypost’s picture

I guess it means that functional tests does not get request properly so url is not extracted, it reminds me somehow #2484991: Add the session to the request in KernelTestBase, BrowserTestBase, and drush

voleger’s picture

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.