WordPress.org

Forums

qTranslate
Still Errors in debug mode (4 posts)

  1. Jacob N. Breetvelt
    Member
    Posted 4 years ago #

    After upgrade to 2.5.19 we have still a lot of errors in debug mode.
    Please fix this as it is extremely easy to do and extremely annoying for the user.

    PLEASE FIX THIS

    Notice: Undefined index: language in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 51
    
    Notice: Undefined index: in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 51
    
    Notice: Undefined index: language in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 52
    
    Notice: Undefined index: in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 52
    
    Notice: Undefined index: language in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 53
    
    Notice: Undefined index: in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 53
    
    Notice: Undefined index: language in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 54
    
    Notice: Undefined index: in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 54
    
    Notice: Undefined index: language in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 55
    
    Notice: Undefined index: language in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 61
    
    Notice: Undefined index: in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 61
    
    Warning: Cannot modify header information - headers already sent by (output started at /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_hooks.php:51) in /mnt/web7/41/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/qtranslate/qtranslate_core.php on line 71

    http://wordpress.org/extend/plugins/qtranslate/

  2. mgiulio
    Member
    Posted 3 years ago #

    Yes, I agree. Please, fix those undefined index notices. They are really annoying when inspecting the log file. Thanks in advance.

  3. Bev
    Member
    Posted 3 years ago #

    I am using version 2.5.28 and I removed these errors by updating the function in qtranslate_hooks.php to the following. If the language is not set it defaults to English.

    function qtrans_localeForCurrentLanguage($locale){
    	global $q_config;
    	// try to figure out the correct locale
    	$locale = array();
    	$lang = isset ($q_config['language'])? $q_config['language'] : 'en';
    	$locale[] = $q_config['locale'][$lang].".utf8";
    	$locale[] = $q_config['locale'][$lang]."@euro";
    	$locale[] = $q_config['locale'][$lang];
    	$locale[] = $q_config['windows_locale'][$lang];
    	$locale[] = $lang;
    
    	// return the correct locale and most importantly set it (wordpress doesn't, which is bad)
    	// only set LC_TIME as everyhing else doesn't seem to work with windows
    	setlocale(LC_TIME, $locale);
    
    	return $q_config['locale'][$lang];
    }
  4. Bev
    Member
    Posted 3 years ago #

    Note - I have since downgraded to qtranslate version 2.5.26 so that edit previews work. The fix I posted above still works with that version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • qTranslate
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags