Hi,

This module is exactly what I needed, thanks!

There is something that's not working correctly though I think

On the content administrator page (Home › Administer › Content management > Content) there are dropdowns for the weight, but once a value is selected there's no button to apply the new setting. I've tried anything but it will reset every time I hit update.

I can change the weight from the node creation or edit page, but changing the weight of a lot of nodes like this takes a lot of time.

I hope this can be fixed soon.

Thanks in advance!

CommentFileSizeAuthor
#14 weight_fix_admin_page.patch547 bytesst0w
#3 weight_add_js.patch766 bytesbitman

Comments

jody lynn’s picture

I am experience the same issue.

nancydru’s picture

Assigned: Unassigned » nancydru

When I was working on this, that stuff was really weird code. It has some kind of JavaScript add-on that makes no sense to me. I definitely would like to work on this page.

bitman’s picture

StatusFileSize
new766 bytes

A patch is attached for this issue. It was created against weight 5.x-1.1-rc1, but 6.x-1.0 should be similar.

Basically, javascript files should be included like this:

drupal_add_js(drupal_get_path('module', 'weight') .'/httpRequest.js', 'module');

And if you call drupal_add_js repeatedly with the same arguments (because weight_node_selector is called multiple times), only one line is output in the HTML header, so $js_included isn't needed any more.

bitman’s picture

Status: Active » Needs review
nancydru’s picture

Status: Needs review » Fixed

I committed this to both branches, but it still doesn't save the revised weight in 6.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

virtualdrupal’s picture

Any idea why this isn't working still in 6.x? I tried the patch to no avail, this is going to weird my users out, would it be difficult to implement the drag & drop method used in the blocks settings (and other similar places...)?

virtualdrupal’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)
nancydru’s picture

I am not a JS person, so, yes, for me, implementing D&D is hard.

virtualdrupal’s picture

I understand, i'm not a JS person either so I suppose it IS as hard as it seems...

Changing the weight from within the actual node works still, so the pull down function from admin/content isn't critical, and with the patches for views2, everything else works great. I'm excited that this mod works, it's so useful I'm surprised it doesn't get more attention. Great job.

my-family’s picture

Assigned: nancydru » Unassigned

I have the same problem. The weight selection is not working on the admin/content/node page.

nancydru’s picture

Assigned: Unassigned » nancydru

@my-family: Unless you think someone else is going to work on this, unassigning me is not good.

I am trying to find out what's not working right.

mpaler’s picture

subscribing

st0w’s picture

StatusFileSize
new547 bytes

The attached patch fixed the problem for me of not being able to alter the weight from the admin/content/node page. Note that the patch posted above in this thread also must be applied to the currently available beta tarball for the update to actually work.

Since the weight module uses the Drupal Node API, all calls to node_load() and node_save() will invoke the appropriate code in the weight module's weight_nodeapi() hook call. So there's no need to do any calculating in the _change_weight() callback function, since it will all be done when _weight2encoded_sticky() is called via the Node API hook when node_save() is called. And since the AJAX callback function is only changing the weight, and not the sticky, it only takes one line.

Hope this helps.

mpaler’s picture

This patch (applied manually cause it's so small) works for me on 6.x-1.0-beta1.

Thanks for the quick fix!!

for the httpRequest.js problem here's what I did in weight.module:

/**
 * Generate JS code for selecting individual node weights on admin page
 */
function weight_node_selector($nid) {
  static $js_included;

  if (!$js_included) {
    $path = drupal_get_path('module', 'weight');
    drupal_add_js($path .'/httpRequest.js', 'module', 'header', TRUE);
    //drupal_add_js('module', 'weight') .'/httpRequest.js';
    $js_included = TRUE;
  }

Sorry I'm super busy tonight so I didn't have time to create a patch...

nancydru’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)