R
ragtek
Guest
I can't save a already existing phrase, where i only changed some small chars to big chars in the title. (sorry don't know how it's called in english )
For example:
old phrasename: ragtek_NUNS_conversation_subject
new phrasename: ragtek_nuns_conversation_subject
errror: Phrase titles must be unique in a language. The specified phrase is already in use.
i think it's because the datawriter checks only if the title exists and it doesn't care of small/big chars
for the datawriter FOO is equal to foo so it's duplicate and it throws the error that it's not equal
For example:
old phrasename: ragtek_NUNS_conversation_subject
new phrasename: ragtek_nuns_conversation_subject
errror: Phrase titles must be unique in a language. The specified phrase is already in use.
i think it's because the datawriter checks only if the title exists and it doesn't care of small/big chars
for the datawriter FOO is equal to foo so it's duplicate and it throws the error that it's not equal
PHP:
protected function _preSave()
{
if ($this->getOption(self::OPTION_CHECK_DUPLICATE))
{
if ($this->isChanged('title') || $this->isChanged('language_id'))
{
$existing = $this->_getPhraseModel()->getPhraseInLanguageByTitle($this->get('title'), $this->get('language_id'));
if ($existing)
{
$this->error(new XenForo_Phrase('phrase_titles_must_be_unique_in_language'), 'title');
}
}
}
}