In order to get admin/node/weight/_change_weight to fire when changing the value in a dropdown, I had to remove the leading "/" in the generated Javascript code.

I'm not attaching a patch since this is a 1 character change from:

    $selector_template = "\n" . "<form><select onchange='httpRequest(\"GET\", \"" . base_path() . "/admin/node/weight/_change_weight/\" + [NID] + \"/\" + this.options[this.selectedIndex].value,true)' >";

to

    $selector_template = "\n" . "<form><select onchange='httpRequest(\"GET\", \"" . base_path() . "admin/node/weight/_change_weight/\" + [NID] + \"/\" + this.options[this.selectedIndex].value,true)' >";

Note that this may only be an issue when base_path() returns "/"...

Comments

marcp’s picture

Status: Active » Needs review

Set status to patch (code needs review).

jjeff’s picture

It sounds like this is a problem with clean vs. "dirty" URLs.

I'm guessing that the url() function could be leveraged to handle the problem better than just using base_path():

$selector_template = "\n" . "<form><select onchange='httpRequest(\"GET\", \"" . url("/admin/node/weight/_change_weight", NULL, NULL, TRUE) ."/\" + [NID] + \"/\" + this.options[this.selectedIndex].value,true)' >";

(untested)

The extra arguments for url() tell Drupal to give the complete absolute URL (which includes the base path). This should make sure that things work for both clean and unclean URL settings.

jjeff’s picture

ugh... nasty... here's some line breaks to make this (slightly) easier to read:

$selector_template = "\n" . "<form><select onchange='httpRequest(\"GET\", \""
  . url("/admin/node/weight/_change_weight", NULL, NULL, TRUE)
  ."/\" + [NID] + \"/\" + this.options[this.selectedIndex].value,true)' >";
harry slaughter’s picture

Status: Needs review » Fixed

i can't reproduce this problem with clean urls on or off.

however, i do see the gratuitous slash. this is fixed in HEAD. Should be in weight version 4.7.x.1.3 if my understanding of the new release process is correct :)

what browser/os are folks using who are seeing this problem?

Anonymous’s picture

Status: Fixed » Closed (fixed)