WordPress.org

Ready to get started?Download WordPress

Forums

Presentation Menu Broken, again (13 posts)

  1. goodsnake
    Member
    Posted 9 years ago #

    I posted yesterday that my Presentation menu was giving me the following message:

    Fatal error: Call to a member function on a non-object in /home/somegre/public_html/wp-includes/functions.php on line 1377

    on the themes and themes editor pages in the Admin.

    I deleted every file in my WP including all the themes and reloaded WP 1.5 and it looked like it solved the problem, until I tried to FTP a theme folder into wp-content/themes this morning and the error message returned. Does anyone have a clue what is wrong.

  2. 33King
    Member
    Posted 9 years ago #

    I'm looking for the same answer

  3. vkaryl
    Member
    Posted 9 years ago #

    This is the relevant code from the error you're getting beginning with line 1373 and ending with line 1380:

    // Files in wp-content/themes directory
    $themes_dir = @ dir($theme_root);
    if ($themes_dir) {
    while(($theme_dir = $themes_dir->read()) !== false) {
    if (is_dir($theme_root . '/' . $theme_dir)) {
    if ($theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS') {
    continue;
    }

    Line 1377 is this one: `if (is_dir($theme_root . '/' . $theme_dir)) {'

    Is there anything weird about where you have located your themes folder? I don't really know enough about php myself to help though....

  4. Smeg0r
    Member
    Posted 9 years ago #

    any new updates on this prob/solution?

  5. Joshua Sigar
    Member
    Posted 9 years ago #

    @goodsnake: So, can I take conclusion that the particular theme that you uploaded is the one that causes the error? Can I have a copy of that theme?

  6. 33King
    Member
    Posted 9 years ago #

    neptune is the theme i am currently getting that error in

  7. Joshua Sigar
    Member
    Posted 9 years ago #

    I tried neptune and didn't get any error. Do you have the latest release: Neptune 0.6.2 beta+bugfix release

  8. 33King
    Member
    Posted 9 years ago #

    uploaded newest theme... didnt help...

    default theme has broken presentation also....

    this one is rough

  9. cvk
    Member
    Posted 9 years ago #

    The relevant lines are:

    1375 $stylish_dir = @ dir($theme_root . '/' . $theme_dir);
    1376 $found_stylesheet = false;
    1377 while(($theme_file = $stylish_dir->read( )) !== false) {

    As you can see, if dir() on line 1375 fails, it fails silently and the bad value isn't caught. A better approach might be to do:

    1375 $stylish_dir = @ dir($theme_root . '/' . $theme_dir);
    1376 if(!$stylish_dir) continue;

    ...which would prevent the nasty error. It might also be good to spit out a warning of some kind. (Something like "Check the permissions and ownership on $theme_dir in your themes/ directory" would work.)

    In my case, the call to dir() fails because PHP does a UID/GID check when in safe mode: It doesn't have permission to read $theme_root/$theme_dir, so $stylish_dir is FALSE. When line 1377 calls ->read() on $stylish_dir, you get a "Call to member function on non-object," which is absolutely reasonable. :)

    To fix this problem, make sure that the user:group combination that owns the new theme directory is the same as the user:group combination that owns your other WordPress files. Also, make sure the permissions are 555 or another reasonable value.

    cd /www/htdocs/wp-content/themes/
    chown apache:apache my_ultra_sweet_theme
    chmod 555 my_ultra_sweet_theme

  10. 33King
    Member
    Posted 9 years ago #

    God Bless You...

    I will follow this sneeze of code and see what happens...

    I was at my wits end...

    I may still be

    BRB

  11. 33King
    Member
    Posted 9 years ago #

    worked

  12. Smeg0r
    Member
    Posted 9 years ago #

    hey that worked for me too!
    bless you
    bless you!

  13. ylaclau
    Member
    Posted 8 years ago #

    Comment for people running WP on Windows XP:

    I had this problem, and basically it was because the folder with the theme didn't have the right permissions assigned.

    Easiest way to do this (assuming everything worked before) is to right click folder where WP is, go to security tab, click on advanced, and check "inherit from parent the permission...blah blah", and click ok.

    Then try everything and it should work fine.

    I wouldn't mess with the code, as suggested above.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.