cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 1.9.1- vsprintf() Too few arguments in app/code/core/Mage/Core/Model/Translate.php line 416

Magento 1.9.1- vsprintf() Too few arguments in app/code/core/Mage/Core/Model/Translate.php line 416

After an update from Magento 1.7 to 1.9.1 .I get the following error:
Array (

   [type] = 2

   [message] = vsprintf(): Too few arguments

   [file] /home/admin/domains/mydomainname.com/public_html/app/code/core/Mage/Core/Model/Translate.php [line] = 416

)

 

On line 416 this line is visible: $result = @vsprintf($translated, $args);
Does anyone know how i can solve this? Or why this is happening?

1 REPLY 1

Re: Magento 1.9.1- vsprintf() Too few arguments in app/code/core/Mage/Core/Model/Translate.php line

I too experienced this problem and, at the same time, my products would not save in the admin. The reason was this: in order to diagnose another fault I had added a custom "register_shutdown_function()" call into my index.php (see below). I had left this in place after fixing the original issue. This causes the the errors that would normally be skipped/ignored (those with the @ at the front) to actually trigger : e.g.

@call_user_func_array('sprintf', $args);

This therefore was returning the actual error to the screen and also adding the same error output to response to any scripts called via ajax (such as the product save process) causing them to break.

Here is the register_shutdown_function I had left running which was causing the issue.

error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ERROR);
/*register_shutdown_function("fatal_handler");
function fatal_handler() {
    $error = error_get_last();
    echo "<pre>";
    print_r($error);
    echo "</pre>";
}*/

Commenting this out, as shown, restored things to normality. I know the question is a bit old but this might help point someone in the right direction. Basically check you are not forcing ALL errors to be shown.