WordPress.org

Ready to get started?Download WordPress

Forums

Setting HEADER_IMAGE to empty string causes Firefox to crash (8 posts)

  1. esmi
    Forum Moderator
    Posted 4 years ago #

    Just started upgrading some themes ready for 3.0 when I came across a bizarre issue. The theme I'm currently working on doesn't have a default header image but offers the standard custom header option so that users can upload their own.

    In 2.9.2, this is achieved using define('HEADER_IMAGE', ''). Using the same approach in 3.0 causes my copy of Firefox (XP/3.6.3) to hang on the Appearance/Header page initially without fully completing the page download. Returning to that page after accessing another Admin option is impossible and Firefox has to be killed via a commandline switch.

    I can replicate the issue in TwentyTen by changing:

    define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' );

    to:

    define( 'HEADER_IMAGE', '' );

    and also by simply commenting out the HEADER_IMAGE define. IE8 manages to remain stable but does display a js error on the second load of Appearance/Header.

    Can anyone else replicate this behaviour?

  2. Huh. It works on my site (which is using a child theme of twentyten), but I have a custom header. Once I killed that, I could repro this.

    I almost want to say that a blank header_image is a strange call to make, and maybe making a default 'CHANGE ME!' would be better? I'm not sure... Definitely trac it though :)

  3. esmi
    Forum Moderator
    Posted 4 years ago #

    Thanks for the feedback. Now it's been confirmed elsewhere I will Trac it. No sign of anything similar on Trac thus far.

    I agree - a blank header is a little strange but I use this theme as a sort of minimalistic framework (the child themes contain all of the graphics). :-)

  4. esmi
    Forum Moderator
    Posted 4 years ago #

  5. A workaround for now would be, obviously, a placeholder image :) One would assume the parent framework could, and would, work on it's own without the babies, and no header image where there's a place for it would be ... mmm ... weird? I dunno, I can easily argue this both ways!

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    Yep - adding a placeholder image is the route I'm taking for the time being. :-) That said, there are (I'm sure) plenty of good pre-existing themes that don't have a default image - thus allowing the user to either stick to a text header or upload their own images/logo.

    And what if you want to create a minimalistic child theme without a graphical header? I've not tried it yet but I'm assuming any attempt to set HEADER_IMAGE to a null string in a child theme could well trigger the same bug.

  7. In theory, if you don't want a header, you wouldn't bother defining HEADER_IMAGE, would you?

  8. esmi
    Forum Moderator
    Posted 4 years ago #

    As a theme developer, I can't make that assumption. Ideally a theme should be able to cater for both groups - those that want an image and those that don't.

Topic Closed

This topic has been closed to new replies.

About this Topic