Issuing warning error - Too few arguments

Started by Nidjo123, April 16, 2011, 04:58:44 PM

Previous topic - Next topic

Nidjo123

When I issue warning to someone everything seems to work normally but when I look into error log, there is this error:
Quote
2: sprintf() [<a href='function.sprintf'>function.sprintf</a>]: Too few arguments
Apply Filter: Only show the errors from this file
Datoteka: /home/yyyyyyy/public_html/Sources/Profile-Actions.php
Line: 338

Here is that part of code:

334: // Setup the "default" templates.
335: foreach (array('spamming', 'offence', 'insulting') as $type)
336: $context['notification_templates'][] = array(
337: 'title' => $txt['profile_warning_notify_title_' . $type],
==>338: 'body' => sprintf($txt['profile_warning_notify_template_outline' . (!empty($context['warning_for_message']) ? '_post' : '')], $txt['profile_warning_notify_for_' . $type]),
339: );


I'm using 2.0 RC5, upgraded from 1.1.13, language is croatian.

2.0 RC5

Nidjo123

#1
Anyone?   ???   At least where's the problem - code, translation or somewhere else?
2.0 RC5

Illori

do you have any mods installed? in a clean install this error message does not occur. can you attach your whole file to your next post so someone may review it?

Arantor

The translation's wrong.

Specifically, lines 398-9 of Profile.croatian.php or Profile.croatian-utf8.php are using an older language string that is different to what the main English one uses.

Code (Profile.croatian.php) Select
$txt['profile_warning_notify_template_outline'] = '%1$s,' . "\n\n" . 'You have received a warning for %2$s. Please cease these activities and abide by the forum rules otherwise we will take further action.' . "\n\n" . $txt['regards_team'];
$txt['profile_warning_notify_template_outline_post'] = '%1$s,' . "\n\n" . 'You have received a warning for %2$s in regards to your message posted [url=' . $scripturl . '?msg=%3$s]here[/url]. Please cease these activities and abide by the forum rules otherwise we will take further action.' . "\n\n" . $txt['regards_team'];


Code (2.0 RC5's Profile.english.php) Select
$txt['profile_warning_notify_template_outline'] = '{MEMBER},' . "\n\n" . 'You have received a warning for %1$s. Please cease these activities and abide by the forum rules otherwise we will take further action.' . "\n\n" . '{REGARDS}';
$txt['profile_warning_notify_template_outline_post'] = '{MEMBER},' . "\n\n" . 'You have received a warning for %1$s in regards to the message:' . "\n" . '{MESSAGE}.' . "\n\n" . 'Please cease these activities and abide by the forum rules otherwise we will take further action.' . "\n\n" . '{REGARDS}';


Notice the change of the number of %1$s entries, which is what sprintf uses. Modify your files to use the English pack and it'll work, and in the meantime someone should notify the Localizer team that there's a problem with this language file - the fact it's not fully translated isn't so much a problem, it's more that it's not using the current English files.

Illori

I posted your last post Arantor in the translation board for you, in hopes someone will look into fixing the issue.

Nidjo123

2.0 RC5

Illori

#6
Relyana reports that the strings have been updated officially and this should not be an issue for anyone else once the language files on the site get rebuilt in about 24 hours.

Advertisement: