Download & Extend

XML-RPC tests fail without clean URLs

Project:Drupal core
Version:7.x-dev
Component:xml-rpc system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:needs backport to D7

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
drupal-xmlrpc-url.patch2.8 KBIdlePASSED: [[SimpleTest]]: [MySQL] 36,619 pass(es).View details | Re-test

Comments

#1

Status:needs review» reviewed & tested by the community

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

#2

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.

#3

Version:8.x-dev» 7.x-dev
Status:reviewed & tested by the community» patch (to be ported)

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.

#4

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

#5

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

#6

Status:patch (to be ported)» needs review

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.

AttachmentSizeStatusTest resultOperations
drupal-1593670-6.patch2.79 KBIdlePASSED: [[SimpleTest]]: [MySQL] 39,093 pass(es).View details | Re-test
nobody click here