Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Ошибка при создании статьи, категории статьи. все что связано с блогом


 Share

Recommended Posts

При добавлении статьи выдает ошибку:

Notice: Undefined index: tag in /home/x/xxx/xxxx/public_html/admin/model/blog/article.php on line 16Warning: Cannot modify header information - headers already sent by (output started at /home/x/xxx/xxxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxx/xxxx/public_html/system/library/response.php on line 36

 

Link to comment
Share on other sites


31 минуту назад, VictorP сказал:

Это чистый ocStore 3.0.2.0 

Действительно в ocStore блог впилили.

Но криво. :)

 

В шаблоне нет переменной для тегов.

 

В файле admin/view/template/blog/article_form.twig

Добавьте после этого блока:

				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-meta-h1{{ language.language_id }}">{{ entry_meta_h1 }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="article_description[{{ language.language_id }}][meta_h1]" value="{{ article_description[language.language_id] ? article_description[language.language_id].meta_h1 }}" placeholder="{{ entry_meta_h1 }}" id="input-meta-h1{{ language.language_id }}" class="form-control" />
					</div>
				  </div>

Вот такой:

				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-tag{{ language.language_id }}">{{ entry_tag }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="article_description[{{ language.language_id }}][tag]" value="{{ article_description[language.language_id] ? article_description[language.language_id].tag }}" placeholder="{{ entry_tag }}" id="input-tag{{ language.language_id }}" class="form-control" />
					</div>
				  </div>

 

  • +1 2
Link to comment
Share on other sites

18 минут назад, VictorP сказал:

Еще раз спасибо! Можете то же самое сделать для категорий блога? 

А там какую ошмбку выдаёт?

Там нет в модели поля tag. И у меня нет под рукой учстановленной версии.

 

Link to comment
Share on other sites

1 минуту назад, mpn2005 сказал:

А там какую ошмбку выдаёт?

Там нет в модели поля tag. И у меня нет под рукой учстановленной версии.

 

Notice: Undefined index: column in /home/x/xxx/public_html/admin/model/blog/category.php on line 7Warning: Cannot modify header information - headers already sent by (output started at /home/x/xxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxxx/public_html/system/library/response.php on line 36

Link to comment
Share on other sites


48 минут назад, VictorP сказал:

Notice: Undefined index: column in /home/x/xxx/public_html/admin/model/blog/category.php on line 7Warning: Cannot modify header information - headers already sent by (output started at /home/x/xxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxxx/public_html/system/library/response.php on line 36

Тут по другому немного.

 

Вот поправленный шаблон:

category_form.twig

 

  • +1 2
Link to comment
Share on other sites

7 часов назад, VictorP сказал:

поставил ошибку выдает: HTTP ERROR 500  

кэш почистил. 

А что в логе ошибок PHP?

При возникновении ошибки 500 в логе должны быть записи.

Link to comment
Share on other sites

Все нормально! работает)) file zila / фтп тупанул. Кинул загружать, старый файл удалился. а новый не загрузился. 

Все работает!!!

Link to comment
Share on other sites


2 часа назад, mpn2005 сказал:

А что в логе ошибок PHP?

При возникновении ошибки 500 в логе должны быть записи.

Спасибо!!!:-)

Link to comment
Share on other sites


А нет. )) ошибки идут. Удалить категорию нельзя. отключить тоже нельзя. 

2019-05-02 11:49:20 - PHP Notice:  Undefined variable: category_id in /home/x/xxxx/xxxxx/public_html/admin/model/blog/category.php on line 137
2019-05-02 11:49:20 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/x/xxxx/xxxxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxxx/xxxxx/public_html/system/library/response.php on line 36
2019-05-02 11:50:32 - PHP Notice:  Undefined variable: category_id in /home/x/xxxx/xxxxx/public_html/admin/model/blog/category.php on line 137
2019-05-02 11:50:32 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/x/xxxx/xxxxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxxx/xxxxx/public_html/system/library/response.php on line 36
2019-05-02 11:54:09 - PHP Notice:  Undefined variable: category_id in /home/x/xxxx/xxxxx/public_html/admin/model/blog/category.php on line 137
2019-05-02 11:54:09 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/x/xxxx/xxxxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxxx/xxxxx/public_html/system/library/response.php on line 36
2019-05-02 11:54:40 - PHP Notice:  Undefined variable: category_id in /home/x/xxxx/xxxxx/public_html/admin/model/blog/category.php on line 137
2019-05-02 11:54:40 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/x/xxxx/xxxxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxxx/xxxxx/public_html/system/library/response.php on line 36

Link to comment
Share on other sites


  • 2 weeks later...

У кого не удаляет в блоге категории в OcStore 3.0.2 в файле dmin/view/template/blog/category_list.twig

найти
<td class="text-center">{% if category.category_id in selected %}
                    <input type="checkbox" name="selected[]" value="{{ category.category_id }}" checked="checked" />
                    {% else %}
                    <input type="checkbox" name="selected[]" value="{{ category.category_id }}" />
                    {% endif %}</td>

 

заменить на

 

<td class="text-center">{% if category.blog_category_id in selected %}
                    <input type="checkbox" name="selected[]" value="{{ category.blog_category_id }}" checked="checked" />
                    {% else %}
                    <input type="checkbox" name="selected[]" value="{{ category.blog_category_id }}" />
                    {% endif %}</td>

  • +1 2
Link to comment
Share on other sites


  • 1 month later...
В 02.05.2019 в 19:12, mpn2005 сказал:

Теперь заменяем файл admin/model/blog/category.php

category.php 17 \u043a\u0411 · 11 downloads

 

Этот блог точно делал какой-то косолапый чудик. 

 

 

В 01.05.2019 в 22:23, VictorP сказал:

При добавлении статьи выдает ошибку:


Notice: Undefined index: tag in /home/x/xxx/xxxx/public_html/admin/model/blog/article.php on line 16Warning: Cannot modify header information - headers already sent by (output started at /home/x/xxx/xxxx/public_html/admin/controller/startup/error.php:34) in /home/x/xxx/xxxx/public_html/system/library/response.php on line 36

 

 

Короче, методом тыка нашел такую зависимость, на чистом ocStore 3.0.2.0, если в настройках хостинга версия PHP (CGI) стоит 5.6.40 (native) тогда при создании статьи лезут ошибки. Выставил любой другой, например 7.2.17 (alt), все норм, ошибок нет при создании статей и категорий.
Но категории все равно не удаляются без правок кода от @akella

Link to comment
Share on other sites


  • 2 weeks later...

Нашел тему в поисках решения по такой-же проблеме. При создании новой статьи получаю ошибку. Что делал: менял версию php на хостинге, добавил файлы которые патчил mpn2005 (заменял файлы по одному). Ошибка все одно остается, хотя статьи сохраняются. ocstore свежеустановленный, ничего не делал кроме включения ЧПУ и SeoPro. Кстати адрес у существующих статей изменился, а у новых по-прежнему, не чпу, хотя поле SEO URL заполнено.

Ошибка:

Цитата

Notice: Undefined index: tag in адрес.ru/admin/model/blog/article.php on line 16Warning: Cannot modify header information - headers already sent by (output started at адрес.ru/admin/controller/startup/error.php:34) in адрес.ru/system/library/response.php on line 36

PS Ранее дел с этим движком не имел, может что элементарное упустил...

 

Edited by Wic
Link to comment
Share on other sites


Странно, сейчас все нормально. Хотя вчера ошибка была, несмотря на то что кэш чистил. Может включени-выключение SeoPro помогло. mpn2005 спасибо за файлы!

Link to comment
Share on other sites


  • 3 months later...

А может мне кто-то из спецов сказать почему в блоге в статье не выводится картинка, хоть в категории и в последних выводится?

Link to comment
Share on other sites


  • 4 weeks later...

Почему я заменяю файлы по этим путям, но ошибки не исчезают что я делаю не так? это при создании статьи...

Notice: Undefined index: tag in D:\OSPanel\domains\oc\admin\model\blog\article.php on line 16Notice: Undefined index: tag in D:\OSPanel\domains\oc\admin\model\blog\article.php on line 16Warning: Cannot modify header information - headers already sent by (output started at D:\OSPanel\domains\oc\admin\controller\startup\error.php:34) in D:\OSPanel\domains\oc\system\library\response.php on line 36

Edited by PLAYTOPMEN
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.