Отзыв о товаре и ошибка #0 Есть решение
Добрый день! Прошу помощи!
Клиент обратился с проблемой - при написания отзыва появляется ошибка 0, но при этом отзыв после обновления страницы добавляется. Проверила - все действительно так. Отзывы у нас редко, поэтому когда возникла проблема - не известно.
Прошерстила все шаблоны - ошибок не нашла, почистила кэш, установила обновления, попробовала предпросмотр магазина с другими темами (в т.ч. Dummy) - ошибка сохранилась. При включенном режиме отладки в консоли выдает следующее:
[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (add, line 0) - это к reviews/add
Error occured: <div style="width:99%; position:relative; text-align: left;">
<h2 id='Title'>Unable to load template file 'review.html' <span class="hint">code 0</span></h2>
<div id="Trace">
<h3>/var/www/www-root/data/www/test.ru/wa-system/waSystem.class.php (497)</h3>
<pre>## /var/www/www-root/data/www/test.ru/wa-system/waSystem.class.php(497)
#0 /var/www/www-root/data/www/test.ru/index.php(7): waSystem->dispatch()
#1 {main}
Next SmartyException with message 'Unable to load template file 'review.html'':
Как я поняла, ругается на шаблон review.html, но в нем ошибок нет - пробовала различные варианты из готовых тем и Dummy, ошибка остается. Куда еще копать не знаю (
7 ответов
Неправильный адрес файла review.html или он отсутствует.
Файл существует и работает - общий список отзывов выводится отлично, а там как раз циклически выводится review.html для каждого отзыва
ошибка в плагине СЕО отключите его и проверьте
Спасибо Вам огромное!!!!!! Ура!!!
Мне не помогло, ошибка похожая, вот что выдаёт у меня в ответ на добавление комментария (в БД он успешно добавляется):
<div style="width:99%;position:relative;text-align:left;white-space:normal" class="wa-exception-debug-dump">
<h2 id='Title'>Unable to load template file 'review.html' <span class="hint">code 0</span></h2>
<div id="Trace">
<pre>## wa-system/waSystem.class.php(497)
#0 index.php(6): waSystem->dispatch()
#1 {main}
Next SmartyException with message 'Unable to load template file 'review.html'':
## wa-system/vendors/smarty3/sysplugins/smarty_internal_templatebase.php(127)
#0 wa-system/view/waSmarty3View.class.php(117): Smarty_Internal_TemplateBase->fetch('file:review.htm...', NULL)
#1 wa-apps/shop/lib/actions/frontend/shopFrontendProductReviewsAdd.controller.php(82): waSmarty3View->fetch('file:review.htm...')
#2 wa-apps/shop/lib/actions/frontend/shopFrontendProductReviewsAdd.controller.php(63): shopFrontendProductReviewsAddController->renderTemplate(Array, 'file:review.htm...')
#3 wa-system/controller/waController.class.php(21): shopFrontendProductReviewsAddController->execute()
#4 wa-system/controller/waJsonController.class.php(28): waController->run(NULL)
#5 wa-system/controller/waFrontController.class.php(229): waJsonController->run(NULL)
#6 wa-system/controller/waFrontController.class.php(164): waFrontController->runController(Object(shopFrontendProductReviewsAddController), NULL)
#7 wa-system/controller/waFrontController.class.php(58): waFrontController->execute(NULL, 'frontend', 'productReviewsA...')
#8 wa-system/waSystem.class.php(698): waFrontController->dispatch()
#9 wa-system/waSystem.class.php(485): waSystem->dispatchFrontend('shtany-palace-b...')
#10 index.php(6): waSystem->dispatch()
#11 {main}</pre>
</div>
<div id="Context" style="display: block;">
<h3>/home/.../www/wa-system/waSystem.class.php around line 497</h3>
<pre>492 $log[] = $e instanceof waException ? $e->getFullTraceAsString() : $e->getTraceAsString();
493 waLog::log(join("\n", $log));
494 }
495 if (class_exists('waException')) {
496 if (!$e instanceof waException) {
>>497 $e = new waException($e->getMessage(), $e->getCode(), $e);
498 }
499 $e->sendResponseCode();
500 }
501 print $e;
502 }</pre>
</div>
<div id="Request">
<h2>GET</h2>
<pre>array()</pre> <h2>POST</h2>
<pre>array(
'title' => 'Тестовый ответ',
'rate' => '0',
'text' => 'пвпва',
'parent_id' => '0',
'product_id' => '209',
'auth_provider' => 'guest',
'count' => '7',
)</pre> </div>
<div style="text-align: left;">
<h2>Params</h2>
<pre>array(
'app' => 'shop',
'theme' => 'default',
'theme_mobile' => 'default',
'locale' => 'ru_RU',
'title' => '...',
'meta_keywords' => '',
'meta_description' => '...',
'og_title' => '...',
'og_video' => '',
'og_description' => '...',
'og_type' => 'website',
'og_url' => '',
'url_type' => '0',
'type_id' => '0',
'currency' => 'UAH',
'stock_id' => '1',
'public_stocks' => '0',
'drop_out_of_stock' => '0',
'payment_id' => '0',
'shipping_id' => '0',
'product_url' => 'shtany-palace-black1',
'module' => 'frontend',
'action' => 'productReviewsAdd',
)</pre>
</div></div>
Ошибка появляется при вызове
$this->renderTemplate(array(
'review' => $this->model->getReview($id, true),
'reply_allowed' => true,
'product' => $product,
'ajax_append' => true),
'file:review.html'
)
в shopFrontendProductReviewsAddController. Сам файл review.html на месте, нормальный, вызывается успешно при рендеринге самой страницы (не через ajax).
В чем может быть причина?
Если быть более точным, то фейлиться в renderTemplate при return во время fetch:
$view = wa()->getView(array('template_dir' => $theme_path));
$view->assign($assign);
return $view->fetch($template);
Путь в переменной правильный, имя - 'file:review.html'
Всё, помогло обновление одного из плагинов...отключение его с очисткой кеша не работало, правда...