• I had a problem exactly as described in this thread:

    http://wordpress.org/support/topic/cheatin-uh

    Since the topic was closed, it will end up sinking to the bottom of the forum – so I wanted to point out the ONLY FIX I’m aware of so far, without waiting for the theme developers to make updates. Fix thanks to crazy.adeel:

    open media-upload.php from admin folder.
    goto line# 125
    remove line#125 and replace it with below
    if ( ! empty( $_REQUEST[‘post_id’] ) && current_user_can( ‘edit_post’ , $_REQUEST[‘post_id’] ) )

    don’t change line#126 ..

    That’s it. Basically, the change was removing “!” in front of current_user_can(‘edit_post’ … so that it doesn’t care whether or not you can edit a post.

    Obviously this is less than ideal of a fix since it opens up a security hole – however, some of us don’t have the luxury of explaining to clients that they have to wait for a wordpress or a theme update.

    Hope this helps someone else out there as much as it helped me! Note to mods – please don’t close threads on active issues. If you want to point the finger at theme developers, fine. But don’t squash the conversation. Please.

Viewing 15 replies - 16 through 30 (of 30 total)
  • Thanks @ kevinslane for really quick work and fast response.
    I will download and replace the file.
    Once after checking the upload logo, favicon, media i will let you know whether it is working or not.
    Thanks a lot

    I hope this works out for you anish_annu…the power of WordPress and Open Source communities, we all help each other out where possible.

    Thanks,
    -Kevin

    @ kevinslane
    Unfortunately that change didn’t work for me at all.
    One change that is working is change in line 126 from the core file that is being discussed. But that too is temporary solution and vulnerable to security as suggested by wordpress community too.
    Can you please help me out and let me know other possibility so that i can get rid of that message.

    Regards

    Please shoot over your theme and I can test anish_annu and let me know where in the theme you are experiencing the problems so I know where to look to test. Please send through transferbigfiles.com and send to h1506118@govector.com.

    Thanks,
    -Kevin

    Many thanks to you @kevinslane. Fixing the post_id to post_ID in my themes works great, without having to touch core.

    For anyone using Elegant themes…go to themename>epanel>js>custom_uploader

    and change all occurences of post_id to post_ID. Worked great for me. I recommend you edit through 7-zip or similar, when i rezipped the theme and uploaded, i began getting a missing css file error.

    @kevinslane… I figured out the _id to _ID stuff as well THANKS TO YOU… phew! I am MUCH indebted to you.
    and thanks mgebers for the tips as well.

    Hey, don’t spread wrong information. As I said before, replacing post_id with post_ID is a wrong solution even if it seems to work fine at a glance. If you think it’s right, you should show us the source about post_ID parameter.

    @ kevinslane, i will attach the screenshot of the error what i am receiving and where soon as i am facing few other issues currently.

    As other members @mgegers, @prbenson also states they found it helpful and were using elegant themes and the change is required in the same file which i have already uploaded and posted as link, i also think this alternative should work for me too. Hope by that time you can figure out and other members may help me.

    Regards

    This issue is caused by changeset 21048. So correct solution is removing added (green) lines in “wp-admin/media-upload.php”, or using post_id=0. You should not use post_ID since it does not exist in WordPress.

    I deleted a picture from media that had been uploaded to the front page under “custom logo”. I relized this error and went to the place in the striking under custom logo and tried to add a new picture and get the error Cheatin eh? I need this fixed ASAP…it’s the logo on the front of our website and it looks terrible.
    [Contact details retracted by moderator]

    If you’re using an Elegant Themes theme, then use this fix described on this above post:
    http://wordpress.org/support/topic/cheatin-uh-when-trying-to-upload-media-via-3rd-party-theme?replies=27#post-3052611

    I have another theory after realizing that my admin user does not have the problem but another user with different privileges was having the problem.

    Most of the images and other changes that were previously successfully submitted were performed by the admin. But more recently I was using a different user with less privileges.

    I have the plug-in User Role Editor installed, and the user that was having the problem has a role based on Editor, but did not have the permission Manage Options checked.

    I tested by using two different computers to test: 1) one logged in as Administrator role to change permissions, 2) another logged in with Editor role to submit changes. I have able to successfully create or fix the problem by simply unchecking or checking the Manage Options permission in the User Role Editor.

    So at least my version of the problem can be fixed by checking the Manage Options permission for the role where you are having the problem.

    I am using: WP 3.5.1 User Role Editor 3.10 (and some other plug-ins).

    I would be interested in your thoughts on the above observations, and whether adding the above User Role Editor plug-in, and manipulating the Manage Options permission is the real cause/fix.

    Simply changing the line towards the bottom that reads tb_show(”, ‘media-upload.php?post_id=0&type=image&TB_iframe=true’); to tb_show(”, ‘media-upload.php?post_ID=0&type=image&TB_iframe=true’); will solve the issue and you won’t have to touch core. The code assumed that the admin would have a hidden field called ‘post_id’ but the WordPress upgrade changed that field so it chokes.

    Thank You Kevin, this definitely solve the issue.
    To have it clearer for other since I was looking for it for sometime

    Find this file inside your “themefolder”/lib/admin/assets/js/admin.js(I’m using elegance theme)

    Then just search the following
    tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true');
    or
    tb_show('', 'media-upload.php?post_id=-629834&type=image&mysite_upload_button=1&TB_iframe=true');

    and then replace it with
    tb_show('', 'media-upload.php?post_ID=0&type=image&TB_iframe=true');

    Hope this solve people issues 😀

    Thanks Mr.producerism……

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘Cheatin uh? (When trying to upload media via 3rd party theme)’ is closed to new replies.