WordPress.org

Ready to get started?Download WordPress

Forums

PHP problems (11 posts)

  1. RossB
    Member
    Posted 6 years ago #

    When I attempt to add a new Category for a post, the new category does not appear on my current list of categories, and I get the following error message:

    Fatal error: Cannot redeclare get_users_drafts() (previously declared in /home/perthpunk/www/theboomtownrap/wordpress/wp-admin/includes/user.php:233) in /home/perthpunk/www/theboomtownrap/wordpress/wp-admin/admin-db.php on line 9

    I have located the user.php and admin-db.php files, but am like one of those people who lift the bonnet of a conked-out car and stare uselessly into the engine without a clue what might be wrong or what they are even looking for!

    Does anyone have a suggestion for modding either PHP file to remedy this error? It's annoying not to be able to add to the post categories I already have, and while I have no idea what's wrong, I imagine it's nothing terribly complicated. PLEASE, could someone who knows PHP assist here?

  2. mechx1
    Member
    Posted 6 years ago #

    Have you recently upgraded, or otherwise re-loaded any files into directory wp-admin? If so, then my best guess is that wp-admin is comprised of files from different releases.

    redeclare_get_drafts() is a function that performs some task. It is declared in a script called user.php. That script is "included" in a script called admin-db.php. Including lets one script incorporate all of the code in another script with a single reference (very handy). However, further in admin-db.php, a function with the same name was declared again, which is illegal.

    Don't mess with this code, try reloading wp-admin from a clean download first.

  3. RossB
    Member
    Posted 6 years ago #

    Thanks for the response, mechx1, but I'm not sure what you mean here. How would I "reload wp-admin from a clean download", pls?

    I did recently upgrade to 2.3.3, from another recent upgrade to 2.3.1 (or whatever it was that preceded 2.3.3). The problem I refer to started happening after the first upgrade, and I was hoping the upgrade to 2.3.3 would fix things up, but it didn't. Wouldn't I have downloaded a fresh version of wp-admin with the recent upgrade to 2.3.3?

    Or am I misunderstanding you completely?

    Cheers
    Ross

  4. mechx1
    Member
    Posted 6 years ago #

    I presumed, perhaps incorrectly, that you downloaded a copy of the upgrade software to your local system, then uploaded it to your /wordpress directory. How are you implementing these upgrades?

    We are trying to understand if /wordpress/wp-admin/includes/user.php and wp-admin/admin-db.php are from the same release.

  5. RossB
    Member
    Posted 6 years ago #

    presumed, perhaps incorrectly, that you downloaded a copy of the upgrade software to your local system, then uploaded it to your /wordpress directory. How are you implementing these upgrades?

    mechx1, your presumption is correct. Actually, I have a blog post showing exactly how I do my upgrades: pls see http://theboomtownrap.perthpunk.com/wordpress/?p=101

    Does this give any clue to the answer to your last question?

    Thanks so much for taking an interest, by the way - really appreciative.

  6. TrishaM
    Member
    Posted 6 years ago #

    You state your own problem in your instructions:

    "overwrite your old wordpress files"

    This is exactly what you should NOT do. The best way to upgrade is to delete the old WordPress files EXCEPT for your wp-config.sys file and your wp-content folder. The only other files you should keep are any specific language files that you need (you may not need them) in your wp-includes folder. (Also it should go without saying but don't delete your .htaccess file either).

    All other wordpress files should be deleted, then upload the new files, being careful to NOT overwrite the wp-config.sys file or the wp-content folder.

    So to fix your problem you should do as mechx1 suggests and do a fresh upgrade - after backing up and deactivating plugins, and backing up your wp-config.sys file and wp-content folder (just to be totally safe).

    Good luck!

  7. RossB
    Member
    Posted 6 years ago #

    Thanks, TrishaM. No doubt you're right - as you'll have noted, I am not a techie - but those upgrade instructions on my blog post I took directly from Codex!

    I have seen conflicting upgrade instructions in Codex, one lot telling us to overwrite the old WP files, and the other stating as you have (although, on just checking back on Codex, I see that there is now a specific instruction to "delete your old wp-includes and wp-admin directories" - I'm almost sure this has been added since I posted my Upgrade blog, but I may be wrong).

    Anyway, things can get pretty confusing for non-techies who don't understand WHY the hell we're doing as the instructions tell us (eg: I have no idea why it "goes without saying" that the .htacccess file shouldn't be deleted...although I fully accept your advice that it shouldn't!).

    Re mechx1's comment: "Don't mess with this code, try reloading wp-admin from a clean download first." - Does this mean that I can download ONLY the Version 2.3.3 wp-admin file and replace my current wp-admin file, without having to do another full upgrade? I hope so, as everything else seems to be working fine.

  8. RosiG
    Member
    Posted 6 years ago #

    I just upgraded from 2.1 to 2.5 today. I'm having the same issue with the Flickr Photo Album plugin. It has the same error.

    I've tried re-uploading from a clean download of v.2.5 and for some reason there is NO admin_db.php file. However, I have it in the backup of my v2.1. I uploaded it but the error doesn't go away so I deleted it again.

    What should I do?

  9. RosiG
    Member
    Posted 6 years ago #

    Ok, I fixed it. I edited the file in the plugin that was calling for admin_db.php to read "admin.php". This seems to have worked fine so far. If I run into any issues, I will post again.

  10. RosiG
    Member
    Posted 6 years ago #

    I found on the TanTan group in flickr that the correct fix is to comment out that line by adding // in front of it and adding another line that reads:

    require_once(dirname(__FILE__).$tmpPath.'/wp-admin/includes/user.php');

  11. RossB
    Member
    Posted 6 years ago #

    mechx1 and TrishaM,

    Just to let you know, I deleted the wp-admin file and replaced it from a fresh download of 2.3.3 - hey presto! Problem fixed.

    I guess that's about all that needs to be said regarding whether old wp-includes and wp-admin directories should be deleted when upgrading, rather than overwritten!

    I will amend my Uberdummies Upgrade Guide blog post accordingly.

    Thanks so much for your help.
    Ross

Topic Closed

This topic has been closed to new replies.

About this Topic