WordPress.org

Making WordPress.org

Changeset 4179


Ignore:
Timestamp:
10/02/2016 08:09:36 PM (4 years ago)
Author:
ocean90
Message:

Translate: Don't call clone if the locale doesn't exist.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/projects-wp-plugins.php

    r2864 r4179  
    6969                // Variants (de/formal for example) don't have GP_Locales in this context
    7070                if ( ! $gp_locale && ( list( $base_locale_slug, $set_slug ) = explode( '/', $locale_slug ) ) ) :
    71                     $gp_locale = clone GP_Locales::by_slug( $base_locale_slug );
    72 
    73                     // Just append it for now..
    74                     $gp_locale->wp_locale .= '/' . $set_slug;
    75                     $gp_locale->english_name .=  ' (' . ucfirst( $set_slug ) . ')';
     71                    $_gp_locale = GP_Locales::by_slug( $base_locale_slug );
     72                    if ( $_gp_locale ) {
     73                        $gp_locale = clone $_gp_locale;
     74                        // Just append it for now..
     75                        $gp_locale->wp_locale .= '/' . $set_slug;
     76                        $gp_locale->english_name .= ' (' . ucfirst( $set_slug ) . ')';
     77                    }
    7678                endif;
    7779
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/projects-wp-themes.php

    r2864 r4179  
    6060                // Variants (de/formal for example) don't have GP_Locales in this context
    6161                if ( ! $gp_locale && ( list( $base_locale_slug, $set_slug ) = explode( '/', $locale_slug ) ) ) :
    62                     $gp_locale = clone GP_Locales::by_slug( $base_locale_slug );
    63 
    64                     // Just append it for now..
    65                     $gp_locale->wp_locale .= '/' . $set_slug;
    66                     $gp_locale->english_name .=  ' (' . ucfirst( $set_slug ) . ')';
     62                    $_gp_locale = GP_Locales::by_slug( $base_locale_slug );
     63                    if ( $_gp_locale ) {
     64                        $gp_locale = clone $_gp_locale;
     65                        // Just append it for now..
     66                        $gp_locale->wp_locale .= '/' . $set_slug;
     67                        $gp_locale->english_name .= ' (' . ucfirst( $set_slug ) . ')';
     68                    }
    6769                endif;
    6870
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/stats-overview.php

    r2864 r4179  
    3030                // Variants (de/formal for example) don't have GP_Locales in this context
    3131                if ( ! $gp_locale && ( list( $base_locale_slug, $set_slug ) = explode( '/', $locale_slug ) ) ) {
    32                     $gp_locale = clone GP_Locales::by_slug( $base_locale_slug );
    33                     // Just append it for now..
    34                     $gp_locale->wp_locale .= '/' . $set_slug;
     32                    $_gp_locale = GP_Locales::by_slug( $base_locale_slug );
     33                    if ( $_gp_locale ) {
     34                        $gp_locale = clone $_gp_locale;
     35                        // Just append it for now..
     36                        $gp_locale->wp_locale .= '/' . $set_slug;
     37                    }
    3538                }
    3639                if ( ! $gp_locale || ! $gp_locale->wp_locale ) {
Note: See TracChangeset for help on using the changeset viewer.