When I go to content management (/admin/content/node), I don't see any weight drop-downs for nodes under 'Operations'. I'll try to investigate further.

Comments

add1sun’s picture

Did you run the db setup at admin/settings/weight > db setup tab?

drupalegg’s picture

I ran the db setup - but still do not see dropdown menu. Any idea?

drupalegg’s picture

I looked at the code weight.module...
-- I changed code:

        if ( in_array(strtolower($form['name'][$nid]['#value']), $weight_node_types) ) {
          $form['operations'][$nid]['weight_selector']['#value'] =  weight_node_selector($nid);
        }

to

      //  if ( in_array(strtolower($form['name'][$nid]['#value']), $weight_node_types) ) {
	   echo "<span></span>";
          $form['operations'][$nid]['weight_selector']['#value'] =  weight_node_selector($nid);
      //  }

To make it work. Unfortunately, this will remove the filter to "only add weight selector if weight is enabled for this node type"

Since I am using "weight" for all the content type, this was not an issue.... sorry I had limited time to make this work...

Also "echo "";" to make sure "edit" is visible under operation.

I hope this make sense...

MattKelly’s picture

add1sun,
Yes I have. I've also confirmed that the nodes are selected under the settings tab. I'll give drupalegg's code change a look soon.

matt@antinomia’s picture

Hrm, I think the problem might be a bit deeper than drupalegg suggests:

$weight_node_types is an array of machine-readable node type.

$form['name'][$nid]['#value'] is the human-readable name of the node type.

Unless the machine- and human- readable versions of the node types are matching, the drop-down won't appear...

I'm not sure what the appropriate fix for this is... Just posting my findings. Will report back if I'm able to fix it.

VLAD_X@drupal.ru’s picture

Try this fix:

diff --git a/weight.module b/weight.module
index b07116a..a835365 100644
--- a/weight.module
+++ b/weight.module
@@ -172,6 +172,11 @@ function weight_form_alter($form_id, &$form){

   $weight_node_types = variable_get('weight_node_types', array_flip(node_get_types('names')));

+  $weight_node_type_names = array();
+  foreach ($weight_node_types as $type) {
+   $weight_node_type_names[] = node_get_types('name', $type);
+  }
+
   // The admin node page does not use the nodeapi for getting lists of nodes, so
   // i never have a chance to convert the sticky flag to 0/1. and trying to
   // filter on that field will not work. therefore, i am going to hide the
@@ -210,7 +215,7 @@ function weight_form_alter($form_id, &$form){
       foreach ( $form['operations'] as $nid => $title ) {
         // only add weight selector if weight is enabled for this node type
                                // In Drupal5, name value is uppercase all of a sudden :(
-        if ( in_array(strtolower($form['name'][$nid]['#value']), $weight_node_types) ) {
+        if ( in_array($form['name'][$nid]['#value'], $weight_node_type_names) ) {
           $form['operations'][$nid]['weight_selector']['#value'] =  weight_node_selector($nid);
         }
       }
nancydru’s picture

Status: Active » Patch (to be ported)

@VLAD_X@drupal.ru: Thank you for the patch. With it and removing the strtolower, this now works.

If I get CVS access, this will be fixed.

nancydru’s picture

Assigned: Unassigned » nancydru
Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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