-0.22
Рейтинг
0.23
Сила
  • avatar Tamias
  • 0
Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'menu.create.content.tpl' in 'nav_content.tpl'' in /home/u781268470/public_html/blogs/engine/lib/external/Smarty/libs/sysplugins/smarty_internal_templatebase.php:127 Stack trace: #0 /home/u781268470/public_html/blogs/engine/lib/external/Smarty/libs/sysplugins/smarty_internal_template.php(288): Smarty_Internal_TemplateBase->fetch(NULL, NULL, NULL, NULL, false, false, true) #1 /home/u781268470/public_html/blogs/templates/compiled/blissplus/869c4bbb68ff139bcd11d959ca2554329c9aff08.file.nav_content.tpl.php(27): Smarty_Internal_Template->getSubTemplate('menu.create.con...', NULL, NULL, NULL, NULL, Array, 0) #2 /home/u781268470/public_html/blogs/engine/lib/external/Smarty/libs/sysplugins/smarty_internal_templatebase.php(180): content_56c1d9ca81f1b2_91951940(Object(Smarty_Internal_Template)) #3 /home/u781268470/public_html/blogs/engine/lib/external/Smarty/libs/sysplugins/smarty_internal_template.php(288): Smarty_Internal_TemplateBase->fe in /home/u781268470/public_html/blogs/engine/lib/external/Smarty/libs/sysplugins/smarty_internal_templatebase.php on line 127
  • avatar vOFFka
  • 0
Не знаю на сколько правильно сделал, но все равно ловлю ошибку:

SQL Error: Invalid default value for 'target_type' at Z:\home\livestreet\www\plugins\questions\classes\modules\favourite\Favourite.class.php line 43
Array ( [code] => 1067 [message] => Invalid default value for 'target_type' [query] => ALTER TABLE `prefix_favourite_tag` MODIFY `target_type` enum('question','topic','comment','talk') NOT NULL DEFAULT '' [context] => Z:\home\livestreet\www\plugins\questions\classes\modules\favourite\Favourite.class.php line 43 ) 


Сделано следующее: в PluginQuestions.class.php вызвал так $this->PluginQuestions_ModuleFavourite_addEnumType (Config::Get('db.table.favourite_tag'), 'target_type', 'question');

В свой Favourite.class.php добавил:

public function addEnumType($sTableName,$sFieldName,$sType,$aConfig=null) {
		$sTableName = str_replace('prefix_', Config::Get('db.table.prefix'), $sTableName);
		$sQuery="SHOW COLUMNS FROM  `{$sTableName}`";

		if ($aRows=$this->Database_GetConnect($aConfig)->select($sQuery)) {
			foreach ($aRows as $aRow){
				if ($aRow['Field'] == $sFieldName) break;
			}
			if (strpos($aRow['Type'], "'{$sType}'") === FALSE) {
				$aRow['Type'] =str_ireplace('enum(', "enum('{$sType}',", $aRow['Type']);
				$sQuery="ALTER TABLE `{$sTableName}` MODIFY `{$sFieldName}` ".$aRow['Type'];
				$sQuery.= ($aRow['Null']=='NO') ? ' NOT NULL ' : ' NULL ';
				if ($aRow['Null']=='NO' and is_null($aRow['Default'])) {
					$aRow['Default']='';
				}
				$sQuery.= is_null($aRow['Default']) ? ' DEFAULT NULL ' : " DEFAULT '{$aRow['Default']}' ";
				$this->Database_GetConnect($aConfig)->select($sQuery);
			}
		}
	}


43-я строка: $this->Database_GetConnect($aConfig)->select($sQuery);
  • avatar vOFFka
  • 0
Подскажите, как происходит валидация полей?

При добавлении записи в экшене запускаю проверку:

/**
		 * Проверка корректности полей формы
		 */
		if (!$this->checkQuestionFields($oQuestion)) {
			return false;
		}


Далее, там же, добавляю функцию:

/**
   * Проверка полей формы
   *
   * @return bool
   */
  protected function checkQuestionFields($oQuestion) {
    $this->Security_ValidateSendForm();

    $bOk=true;
    /**
     * Валидируем вопрос
     */
    if (!$oQuestion->_Validate()) {
      $this->Message_AddError($oQuestion->_getValidateError(),$this->Lang_Get('error'));
      $bOk=false;
    }

    return $bOk;
  }


В сущности определяю правила:

/**
	 * Определяем правила валидации
	 */
	public function Init() {
		parent::Init();
		$this->aValidateRules[]=array('question_title','string','max'=>200,'min'=>2,'allowEmpty'=>false,'label'=>$this->Lang_Get('plugin.questions.question_title'));
		$this->aValidateRules[]=array('question_text_source','string','max'=>Config::Get('plugin.questions.question_max_length'),'min'=>2,'allowEmpty'=>false,'label'=>$this->Lang_Get('plugin.questions.question_text'));
		$this->aValidateRules[]=array('question_tags','tags','count'=>15,'label'=>$this->Lang_Get('plugin.questions.question_tags'),'allowEmpty'=>false);
		$this->aValidateRules[]=array('question_text_source','question_unique');
	}

  /**
	 * Проверка вопроса на уникальность
	 *
	 * @param string $sValue	Проверяемое значение
	 * @param array $aParams	Параметры
	 * @return bool|string
	 */
	public function ValidateQuestionUnique($sValue,$aParams) {
		$this->setTextHash(md5($sValue.$this->getTitle()));
		if ($oQuestionEquivalent=$this->PluginQuestions_Question_GetQuestionByUserIdAndTextHash($this->getUserId(),$this->getTextHash())) {
			if ($iId=$this->getId() and $oQuestionEquivalent->getId()==$iId) {
				return true;
			}
			return $this->Lang_Get('plugin.questions.questions_create_text_error_unique');
		}
		return true;
	}


И даже при полностью пустых полях запись публикуется (пустая), т.е. поля проходят валидацию. Что я упускаю?
lifecom то что ты сказал сделал. Все ок. Работает хорошо.
Но после добавление етого мета тега на форуме не видно посты.
<meta property="og:title" content="{$oTopic->getTitle()|escape:'html'} / {$oTopic->getBlog()->getTitle()} blogu  " />


Одним словом. Конфликтуют етот мета тег с форумом.
Ошибка видно тоько на топиках форума.

<meta property="og:title" content="Sözlük / <br />
<b>Fatal error</b>:  Call to a member function getTitle() on a non-object in <b>/.../templates/compiled/atlass/e7c2b18c2895ba5083a5a974ddef3a1df312933b.file.header.tpl.php</b> on line <b>99</b><br />


Как удалил етот мета тег на форуме топики видно без проблем.

Как исправить? Что надо сделать что бы етот мета тег не конфликтовал с форумом.
/templates/skin/synio/css/jquery.notifier.css

#notifier .n-box.n-error { background: #850505; color: #fff; }
ERROR: index 'entityprefixtopicsIndex': sql_connect: Access denied for user 'test'@'localhost' (using password: YES) (DSN=mysql://test:***@localhost:3306/testbase).
Говорит о том что вы в настройках указали неправильный пароль для доступа к БД
обновился с гитхаба, теперь при разлогировании периодически выскакивает: Forum message: Marker Error [0] в логах форума соответственно такое:
[2013-03-23 22:46:31][0][3487][ERROR][Forum message: Marker Error [0]
]
[2013-03-23 22:46:46][0][8261][ERROR][Forum message: Marker Error [0]
]
[2013-03-23 22:46:48][0][7508][ERROR][Forum message: Marker Error [0]
]
Fatal error:  Call to a member function getParentId() on a non-object in /var/www/topix202/data/www/xbizz.ru/templates/compiled/fortune/043428649f184a80f74f5337692b4ab86dd8afe9.file.category.bc_toggle.tpl.php on line 27

проблема та не в шаблоне…