Before anything else, I know there was an issue about this, but it was marked as fixed 18 months ago. But now, with the latest dev, the problem is there again.

But the main reason I didn't not opened that issue is because this should be fixed properly and the weight added to the form in a more drupal way and not the "hackish" and ugly way there is now.

So here is a patch that uses a proper hook_form_FORM_ID_alter() to alter the form and it uses AHAH to save the changes and with that removes the need for httpRequest.js.

Comments

tic2000’s picture

StatusFileSize
new6.42 KB

New patch that preservers the status information that where removed by mistake in the previous one.

askibinski’s picture

Patch works!

sgabe’s picture

I can confirm that the patch in #1 applies fine and works like a charm, thank you!

davisben’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Assigned: Unassigned » davisben
Status: Needs review » Active

Committed to 6.x-1.x. I'm starting work on a D7 version of this now.

davisben’s picture

Assigned: davisben » Unassigned
Category: bug » feature

Looks like this isn't possible with the tableselect form element, because any form elements added to the #options array (the table rows) aren't rendered by the FAPI. Anyone have any ideas to work around this?

davisben’s picture

Title: Changing weight from contentpage doesn't work; throws httpRequest error » Changing weight from content admin page doesn't work

Updating title.

quasi’s picture

I'd also love to see this work.

toppen56’s picture

I would also love for this to work. Just installed the Drupal 7 module and was disappointed to see this feature doesn't work. Hope you find someone who can offer a solution.

mavdiablo’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Category: feature » bug
StatusFileSize
new4.14 KB

I'm using this module on the 7.10 version but I don't find the way to modify weight on the admin content list.
I'm using 7.20 core version.
What's wrong?
Thank you for the reply.

davisben’s picture

Please read the comments, the answer is in #5.

futurist’s picture

So is this a core issue? Bringing this functionality back (plus drag'n'drop in the table) would greatly improve Weight's usefulness. Unfortunately I don't know how to approach this...

davisben’s picture

Version: 7.x-1.0 » 7.x-2.x-dev

There is a core issue about this, #1396320: Tableselect: add additional form elements in #options array. There is a suggestion for a work around that I'm planning on trying, just haven't had a chance yet.

davisben’s picture

Status: Active » Fixed

I was able to get this working using the work around in that issue. It still needs some work to optimize it (too many node loads), but it's working.

futurist’s picture

Cool, but after the update (to 7.x-2.0-beta2+11-dev, 2012-02-22) I get a notice for each node where a weight has not been explicitly set (weight for those is shown as -20 in the dropdown) on admin/content:

Notice: Undefined index: und in weight_form_node_admin_content_alter() (line 124 of [path to root]/sites/all/modules/weight/weight.module).

Running Drupal 7.9.

futurist’s picture

Status: Fixed » Active
davisben’s picture

Status: Active » Fixed

A fix for this has been committed. To get rid of the errors, go to admin/structure/types and resave each content type that is weight enabled. This will populate all nodes of that type with the default weight, if it doesn't already have a weight set.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.