Installed and configured this module, I browsed to my page taxonomy/term/1, which display a few nodes. I clicked "move up" links under the nodes, I got an message:

You are not authorized to access this page.

But I'm the administrator (user 1).

I went to user management/access control, gave authenticated user the permission of "order nodes within categories". In this case I clicked "move up" links under the nodes, I saw an massage like this:

this node was moved in this term ...

but the node I tried moving was still there, not moved.

CommentFileSizeAuthor
#2 node_cannot_move.jpg47.03 KBastra

Comments

marcp’s picture

Was this working for you in 4.7? Did you start with a clean 5.1 installation?

Could you please attach a screenshot of page taxonomy/term/1 before clicking the "move up in XXX" link.

Thanks,
Marc

astra’s picture

StatusFileSize
new47.03 KB

My site runs with a clean 5.1 installation, not upgrates from version 4.7. Here is a screenshot of my page taxonomy/term/1

marcp’s picture

Looks like you may have a view overridden that's causing this. What happens when you show the page nodeorder/term/1 -- do you see the order that you want?

Search back through the Nodeorder issues to see if there's anything regarding Views integration. I can't remember what the current status is, but I'm pretty sure there's an easy way for your view to use the weight_in_tid field (that was added by Nodeorder) from the term_node table for ordering nodes in your taxonomy Views.

Please report back here with the solution and/or continued debugging info.

astra’s picture

If browse to the page nodeorder/term/1, I get almost same display as the page taxonomy/term/1, but plus a link "Set the order of nodes in xxx" between the term title and the nodes. Clicking this link I get a fatal error:

Fatal error: Call to undefined function: interface_sortable_element() in .../sites/all/modules/nodeorder/nodeorder.module on line 366
marcp’s picture

The fatal error is a whole separate ballgame. In order to use drag-and-drop ordering, you need to install the jQuery Update, jQuery Interface, and jQuery Interface Sortable modules. So, if they're not installed then we shouldn't let you see that "Set the order of nodes in xxx" link and/or when you go to that page it should tell you some useful information.

If you are on nodeorder/term/1 and you click move up or move down on one or more of the nodes links, do you see that the order has changed? You may need to go back to nodeorder/term/1 after pressing move up or move down.

Do you have the taxonomy view(s) overridden?

astra’s picture

According to the instruction of the module Nodeorder:

In order to use drag and drop node ordering feature, install the jQuery Update module and the
jQuery Interface module. Follow those two modules' installation instructions and test to make sure they are working. Installing Message Effects will test jQuery Update and jQuery Interface, so it's not a bad idea to install it before installing Nodeorder.

I first installed jQuery Update, jQuery Interface and Message Effects before I installed Nodeorder. Also I had a test and notice that Message Effects works well. After that I installed and tried using Nodeorder. But got this problem.

By the way, I didn't install Interface Sortable module because the instruction do not mention that.

On the page nodeorder/term/1, if I click move up or move down on one or more of the nodes links, sometime can move but somtimes get a blank page body with message below:

 Access denied
There was a problem moving the node within its category.
You are not authorized to access this page.

What do you mean about taxonomy view(s) overridden?

marcp’s picture

I need to update the documentation -- this module requires the jQuery Interface Sortable module in order to use drag-and-drop ordering.

You may be getting the Access Denied message when you try to move the top item up or the bottom item down. Neither of those operations should be allowed (there is another issue that addresses this).

Please test to see whether it's just these end-cases that are causing Access Denied messages. If you get the drag-and-drop ordering working, you won't go back to using those links to move the nodes anyway.

astra’s picture

I get the Access Denied message when click move up or move down on one or more of the nodes links BETWEEN the top item and the bottem item. For the end-cases, there are the same problem to try moving the top item up or the bottom item dowm.

I will install the jQuery Interface Sortable module to use drag-and-drop ordering, and see what happen. But hope it also works without using drag-and-drop ordering.

marcp’s picture

Let us know how the drag-and-drop goes. Please feel free to contact me via my contact form and I will try to help you debug this on your site.

astra’s picture

Installed the jQuery Interface Sortable module, I can go to the page nodeorder/order/1 to drag and drop nodes to change their ordering. But when I go back to the page taxonomy/term/1, these nodes still have the original order, not changed.

How to display the node list with the new order what I want?

marcp’s picture

Please contact me and I will try to help you get to the bottom of this issue.

karlrees’s picture

I also have the problem where drag-and-drop doesn't change any of the weights. Has there been any progress on figuring out what's wrong? Might a "submit" button be an easy workaround for this?

marcp’s picture

I'm starting to suspect that the problem may be with the Ajax callback. In nodeorder.module there is a line that looks like this:

            url: "/nodeorder/reordered",

Try changing "/nodeorder/reordered" to "http://yourdomain.com/nodeorder/reordered" (replacing http://yourdomain.com with whatever it is that gets you to your Drupal site) and let me know if that fixes it. If it does, then I'll fix the code to automatically create the full url.

Thanks,
Marc

marcp’s picture

Try the new 5.x-1.2 release and let me know if it fixes the problem for you.

astra’s picture

Updated to 5.x-1.2 release, the problem of my site is not fixed yet. I can't see anything changed.

Then I try to have a test what you said in #13, but in nodeorder.module (5.x-1.2) I can't find this line

url: "/nodeorder/reordered",
marcp’s picture

@astra - In the 5.x-1.2 version I tried to fix what I thought might be your problem, so you won't find the offensive line. The problem must be something else. I don't really have the ability to reproduce the problem so I'll need access to your site.

Please contact me and I will try to help you get to the bottom of this issue.

pvanderspek’s picture

Has this problem been solved already? At least I'm getting the same message when using the latest official release (5.x-1.2).

marcp’s picture

pvanderspek - what is the message that you are getting?

pvanderspek’s picture

Exactly the same one as above:

 Access denied
There was a problem moving the node within its category.
You are not authorized to access this page.

Even though I'm logged in as user 1.

marcp’s picture

I think this went away for astra when jQuery Interface Sortable was installed. Do you have that module installed and activated?

pvanderspek’s picture

I've already installed jquery interface sortable, jquery interface library and jquery update.

pvanderspek’s picture

Little update: it appears that its just not possible to move the top item down or the bottom item up. Tried in both FF2 and IE7, but that doesn't make a difference.

pvanderspek’s picture

OK, I finally discovered what I was doing wrong. Apparently you can order nodes on the page 'taxonomy/term/TID' but if you do that, it doesn't work with the top or bottom node. Everything works fine when you do it on the page 'nodeorder/term/TID'. Problem solved I guess.
Maybe its a good thing to update the README, because it doesn't say anything about the special nodeorder page. I found that in another support request.

Subtropical_305@drupal.org’s picture

Hi,

I'm having the same problem astra was having - when I access nodeorder/term/tid page, I am able to see nodes in the order I have set, and move them, and see the new order. But when I access the page from the menu or the link, I don't see the changes. I looked through the discussion here but I'm not clear on whether a resolution was found for this problem, and if so, what the resolution was?

I am trying this with the standard image gallery content type, where each image is its own node. I am using Drupal version 5 and nodeorder v1.2

I am a noob @ drupal so I hope I have provided enough information here...Please let me know if I've left out anything important.

thanks

marcp’s picture

You may try searching for nodeorder and image on drupal.org. I know there are folks who have gotten stuff like this working together -- read through all of http://drupal.org/node/117587 for some possible insight. Please post here if and when you solve this.

halftone’s picture

Following on frpm #25, you may hope and expect that just installing and using Nodeorder will allow Drupal to display nodes in the order you have set. Unfortunately as far as I know no modules are coded to utilise the weight_in_tid field that Nodeorder utilises, and they will just display in the usual 'sticky+upload date' default Drupal order. To get them them to honour Nodeorder's running order you will need to dig into the module code and locate and modify the SQL that selects the nodes for display, along the lines mentioned at the link Marc gave. The final msg. in that thread shows how the SQL of the Image module has been hacked to use weight_in_tid if present but default to normal Drupal ordering if not. See the bits where it says //HACK.... //END OF HACK.

(This really ought to be an Image module patch but I'm not a developer, I barely know WTF I'm doing, and am on Windows where I have a terrible time patching using Cygwin. I haven't managed to produce a patchfile. So it is a deplorable, horrible hack instead. But it does work:).

All this confused the hell out of me when I first began using Nodeorder as I assumed Drupal modules would be inherently capable of working together. It really should be the case, and it would be nice if module authors would support Nodeorder 'cos if you need it, it is absolutely indispensible. But until then, you'll just have to bodge the SQL yourself in any module where you want explicit control of its nodes.

Subtropical_305@drupal.org’s picture

thanks halftone & marcp,

I read the other thread that was linked, that is pretty much exactly the problem I am having (I want to use nodeorder for image gallery). I am not really familiar w/ mySQL but it sounds like the hack is the way to get image gallery to play nice w/ node order. I'll see if I can get it sorted out.

thanks again!

halftone’s picture

Here's the code to make the image galleries respect Nodeorder in Drupal 5.n. NB that if Nodeorder isn't installed it defaults to normal Drupal sticky+upload date behaviour.

Find image_gallery.module in /sites/all/modules/image/contrib and replace the entire image_gallery_page function with the code below.

<?php
/**
 * Image gallery callback, displays an image gallery
 */
function image_gallery_page($type = NULL, $tid = 0) {
  $galleries = taxonomy_get_tree(_image_gallery_get_vid(), $tid, -1, 1);
  for ($i=0; $i < count($galleries); $i++) {
    $galleries[$i]->count = taxonomy_term_count_nodes($galleries[$i]->tid, 'image');
    $tree = taxonomy_get_tree(_image_gallery_get_vid(), $galleries[$i]->tid, -1);
    $descendant_tids = array_merge(array($galleries[$i]->tid), array_map('_taxonomy_get_tid_from_term', $tree));
    // The values of $descendant_tids should be safe for raw inclusion in the
    // SQL since they're all loaded from integer fields in the database.
// HACK TO ALLOW NODEORDER TO WORK IF USED TO SET IMAGE SEQUENCE (weight_in_tid)
    if (module_exists ('nodeorder')) {
      $sql = 'SELECT n.nid FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. implode(',', $descendant_tids) .') AND n.status = 1 ORDER BY n.sticky DESC, tn.weight_in_tid ASC';
    }
    else {
          $sql = 'SELECT n.nid FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. implode(',', $descendant_tids) .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
    }
// END HACK
    if ($nid = db_result(db_query_range(db_rewrite_sql($sql), 0, 1))) {
      $galleries[$i]->latest = node_load(array('nid' => $nid));
    }
  }

  $images = array();
  if ($tid) {
// HACK TO ALLOW NODEORDER TO WORK
     if (module_exists ('nodeorder')) {
       $result = pager_query(db_rewrite_sql("SELECT n.nid FROM {term_node} tn INNER JOIN {node} n ON tn.nid=n.nid WHERE n.status=1 AND n.type='image' AND tn.tid=%d ORDER BY tn.weight_in_tid ASC"), variable_get('image_images_per_page', 6), 0, NULL, $tid);
     }
     else {
       $result = pager_query(db_rewrite_sql("SELECT n.nid FROM {term_node} t INNER JOIN {node} n ON t.nid=n.nid WHERE n.status=1 AND n.type='image' AND t.tid=%d ORDER BY n.sticky DESC, n.created DESC"), variable_get('image_images_per_page', 6), 0, NULL, $tid);
     }
// END HACK
    while ($node = db_fetch_object($result)) {
      $images[] = node_load(array('nid' => $node->nid));
    }

    $gallery = taxonomy_get_term($tid);
    $parents = taxonomy_get_parents($tid);
    foreach ($parents as $parent) {
      $breadcrumb[] = array('path' => 'image/tid/'. $parent->tid, 'title' => $parent->name);
    }
    $breadcrumb[] = array('path' => 'image', 'title' => t('Image galleries'));
    $breadcrumb = array_reverse($breadcrumb);
    drupal_set_title($gallery->name);
  }

  $breadcrumb[] = array('path' => $_GET['q']);
  menu_set_location($breadcrumb);
  $content = theme('image_gallery', $galleries, $images);
  return $content;
}

?>
marcp’s picture

Status: Active » Fixed

Setting this to fixed. Re-open if there are still issues.

Status: Fixed » Closed (fixed)

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