• Resolved sjaffredo

    (@sjaffredo)


    Hi
    I just upgraded from 1.5 to 2.1 and I can’t seem to be able to delete posts. I don’t use a .htaccess file and I’m propermy logged in as admin. What can I do?
    Thanks for your answer

Viewing 10 replies - 1 through 10 (of 10 total)
  • What happens when you delete the post? Can you write a test post and delete that?

    Thread Starter sjaffredo

    (@sjaffredo)

    Thanks for your answer. I can write a new post but when I try to delete it I get a message error “You are not allowed to delete this post.”
    The only way I found to delete was to do it directly in phpMyAdmin, but I don’t like to mess with the database.
    I saw many people had the problem after upgrading from 1.5 to 2.1. I tried all solutions (delete cookies, cache, wordpress-2.0.3-tuneup.php, and force-upgrade.php) but nothing worked.
    Any idea for me?

    Maybe something with the user account for that post.

    Assuming the post is written by you the administrator, create a new user with the administrator role. Log out and log in as the new administrator. Demote the old admin user (make subscriber or the like) then promote that old admin user back to administrator. Then log out and use the old admin account. Does that do anything?

    Thread Starter sjaffredo

    (@sjaffredo)

    Nope. Tried it, to no avail.
    Looks like there’s a problem with the permissions in the database that occurs when updating automatically from 1.5 to 2.0 or 2.1, only I have no idea what it is exactly and how to fix it.

    Well the message “You are not allowed to delete this post” is a result of this test in wp-admin/post.php

    
    if ( !current_user_can('delete_post', $post_id) )
    wp_die( __('You are not allowed to delete this post.') );
    

    So there must be something wrong with that user’s capabilities.

    My admin user, in the wp_usermeta table for the meta_key “wp_capabilities” has the value:
    a:1:{s:13:”administrator”;b:1;}

    Maybe check that.

    Thread Starter sjaffredo

    (@sjaffredo)

    Hi Michael, thanks again for your support.
    I checked out the DB and I do have the same value
    a:1:{s:13:”administrator”;b:1;}
    for both administrators.
    Still, none can delete posts.
    Would there be a bug in my function !current_user_can()? Where is that function defined and what should the correct code for it?

    Thread Starter sjaffredo

    (@sjaffredo)

    OK, I found it in capabilities.php as on my server

    // Capability checking wrapper around the global $current_user object.
    function current_user_can($capability) {
    $current_user = wp_get_current_user();

    $args = array_slice(func_get_args(), 1);
    $args = array_merge(array($capability), $args);

    if ( empty($current_user) )
    return false;

    return call_user_func_array(array(&$current_user, ‘has_cap’), $args);
    }

    The whole file is actually perfectly similar to the capabilities.php unzipped from the download package.

    Just for information, I have the same problem. Installed it on my computer at home first and everything worked fine, but when I installed it on my web server I got this “rights” problem.

    Installed version 2.1.

    //Nick

    Thread Starter sjaffredo

    (@sjaffredo)

    Hi Nick thanks for your testimony. Please drop a wsord here if you find a solution to our problem!

    Thread Starter sjaffredo

    (@sjaffredo)

    Hey, I finally solved the problem thanks to this trick.

    Hope it works with other people, and that it’ll be implemented in the next application fix.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Can’t delete post’ is closed to new replies.