Hello!

I have the following problem with my 4.0.0 drupal:

I can create revisions of my documents and view them (different versions are shown) but when i click "rollback revision" or "delete revision" (to test, i created 3 revisions, and tried each one) i get redirected to: http://www.cargal.org/drupal/admin.php?mod=node and nothing changes, the last revision stays. No error messages are displayed.

Did i overlook something in the configuration or what am i doing wrong?

Many thanks in advance,

Ciao,

Steve

Comments

lotussteve@cargal.org’s picture

Hello!

I have now tried it out at another installation of a friend of mine (www.al-bustan.org/drupal), same thing there: "delete revision" and "rollback revision" don`t do anything when clicked. Do i have to change something?

Please help!

Thanks,

Ciao,

Steve
--
www.cargal.org
GnuPG-key at www.cargal.org/interact/keys/Publotuskey.asc
"Be the change you want to see in the world"-Mahatma Gandhi
Jabber-ID: lotussteve@cargal.org

PiAir’s picture

I'll post a patch file to the dev-mailinglist also, but the changes needed are small enoug to also post them here:

Steve is right, nothing really happens, and that is because of the space in "rollback revision" and "delete revision".
For the link, that space is manually being replaced by a "+", but in the case statement checing for the selected option, the check is done without the "+".

FIX

In node.module find:

      case "rollback revision":
        print node_revision_rollback(node_load(array("nid" => $id)), $revision);
        print node_admin_edit($id);
        break;
      case "delete revision":
        print node_revision_delete(node_load(array("nid" => $id)), $revision);
        print node_admin_edit($id);
        break;

and change it into:

      case "rollback+revision":
        print node_revision_rollback(node_load(array("nid" => $id)), $revision);
        print node_admin_edit($id);
        break;
      case "delete+revision":
        print node_revision_delete(node_load(array("nid" => $id)), $revision);
        print node_admin_edit($id);
        break;

Now revisions function like expected. Only local images are allowed.

lotussteve@cargal.org’s picture

Hello!

Yippee, that did the trick! It works perfect now! Maybe it should be posted to the FAQ/Installdoc/front page?

Many thanks again,

Ciao,

Steve
--
www.cargal.org
GnuPG-key at www.cargal.org/interact/keys/Publotuskey.asc
"Be the change you want to see in the world"-Mahatma Gandhi
Jabber-ID: lotussteve@cargal.org

urbanfalcon’s picture

I'm using 4.5.x, and in my case the problem was in a different area. The switch/case as described above used a dash to prevent the space issue. However, on rollback, a field in the UPDATE mySQL query was being called that didn't actually exist in the node table (field name was "0" and always had no value). I don't really know why this was happening, but this is what fixed it:

In node.module, function node_save ($node), make sure the update loop checks that all field names are strings (as is done in the insert loop):

    // Prepare the query:
    foreach ($node as $key => $value) {
      if (in_array((string) $key, $fields)) {
        $q[] = check_query($key) ." = '%s'";
        $v[] = $value;
      }
    }

Worked for me!