Changing weight from contentpage
libeco - September 27, 2008 - 15:57
| Project: | Weight |
| Version: | 6.x-1.0-beta1 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | NancyDru |
| Status: | duplicate |
Description
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!

#1
I am experience the same issue.
#2
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.
#3
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.
#4
#5
I committed this to both branches, but it still doesn't save the revised weight in 6.x.
--project followup subject--
Automatically closed -- issue fixed for two weeks with no activity.
#6
Automatically closed -- issue fixed for two weeks with no activity.
#7
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...)?
#8
#9
I am not a JS person, so, yes, for me, implementing D&D is hard.
#10
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.
#11
I have the same problem. The weight selection is not working on the admin/content/node page.
#12
@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.
#13
subscribing
#14
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.
#15
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...
#16
#356335: Changing weight from contentpage doesn't work; throws httpRequest error