This was discovered by Niklas Fiekas (please credit him on commit) while working on #1463656: Add a Drupal kernel; leverage HttpFoundation and HttpKernel, but is unrelated to that issue, so is being split out here.

This can be replicated locally by accessing a Drupal installation with a dirty URL ("/index.php" appended in the address bar after the base url), and from there running the XML-RPC tests. Doing so currently results in test failures with HEAD. Testbot is not catching this, because it runs tests with clean URLs.

The problem is code like this:

$url = url(NULL, array('absolute' => TRUE)) . 'core/xmlrpc.php';

This makes no sense. url() is used for generating URLs to Drupal paths or external URLs. It is not meant for generating a URL to a file. For that, $base_url must be used instead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

effulgentsia’s picture

Status: Needs review » Reviewed & tested by the community

RTBC'ing cause it's not my patch :)

fgm’s picture

This issue with paths to actual files was already discussed long ago, and the ability to use url() for files in cases like this was won't fixed at the time, so maybe we should check when it was reintroduced: the same may have been done elsewhere.

catch’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
Issue tags: +Needs backport to D7

Ah crap I'm still waking up this morning and forgot to credit Niklas Fiekas on commit, I'll try to make another mistake with another commit to correct this..

This is in 7.x too so needs a backport.

Crell’s picture

If you haven't pushed yet you can always commit --amend to fix it. :-)

catch’s picture

Nah I already pushed it before even starting to type the comment :(

tim.plunkett’s picture

Status: Patch (to be ported) » Needs review
FileSize
2.79 KB

Needed to be rerolled manually since every new line referred to '/core/xmlrpc.php'.
I grepped around for other instances to change, didn't see any.

Crell’s picture

Is this even still relevant? xmlrpc isn't its own front controller anymore, so I suspect we can just close this.

mgifford’s picture

6: drupal-1593670-6.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 6: drupal-1593670-6.patch, failed testing.

  • catch committed 39f51ca on 8.3.x
    Issue #1593670 by effulgentsia: Fixed XML-RPC tests fail without clean...

  • catch committed 39f51ca on 8.3.x
    Issue #1593670 by effulgentsia: Fixed XML-RPC tests fail without clean...
fgm’s picture

Issue summary: View changes

How can this commit exist on the 8.x branches which don't have the underlying XML-RPC code ? The files don't exist, and yet they show on git.drupal.org ? Looks like a bug.

http://cgit.drupalcode.org/drupal/tree/core/modules/system?h=8.3.x&id=39...

And this is a 2012 commit:
git show
commit 39f51caa8e750a6edf0ee8684a75a7a3d7cb8863
Author: catch
Date: Fri May 25 12:48:07 2012 +0900

  • catch committed 39f51ca on 8.4.x
    Issue #1593670 by effulgentsia: Fixed XML-RPC tests fail without clean...

  • catch committed 39f51ca on 8.4.x
    Issue #1593670 by effulgentsia: Fixed XML-RPC tests fail without clean...

  • catch committed 39f51ca on 9.1.x
    Issue #1593670 by effulgentsia: Fixed XML-RPC tests fail without clean...