TeamEver / everpsblog

Free blog module for Prestashop 1.7 & 8
https://www.team-ever.com/prestashop-1-7-un-module-de-blog-gratuit/
Academic Free License v3.0
26 stars 3 forks source link

Adding Post & Author runs into Server Error #4

Closed pankajpatel closed 2 years ago

pankajpatel commented 2 years ago

I am trying to use the module on almost fresh PrestaShop installation and I receive errors while adding Post and Author.

PHP version: 7.4.24 PrestaShop version: 1.7.8.0 Current theme in use: classic

Installation is done via Docker

Trace for Post Adding:

Post Error
Symfony\Component\Debug\Exception\ContextErrorException:
Notice: Trying to access array offset on value of type null

  at var/cache/dev/smarty/compile/7c/cc/af/7cccafd77d004e6fa87955b64636e3027a686ecd_0.file.form.tpl.php:916
  at Block_117711286061824a2fb6ac30_76661435->callBlock(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:248)
  at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_117711286061824a2fb6ac30_76661435), object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:184)
  at Smarty_Internal_Runtime_Inheritance->process(object(Smarty_Internal_Template), object(Block_117711286061824a2fb6ac30_76661435))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:156)
  at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(Smarty_Internal_Template), 'Block_117711286061824a2fb6ac30_76661435', 'input', 0)
     (var/cache/dev/smarty/compile/7c/cc/af/7cccafd77d004e6fa87955b64636e3027a686ecd_0.file.form.tpl.php:1478)
  at Block_171969554661824a2fb5e9d9_39617553->callBlock(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:248)
  at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_171969554661824a2fb5e9d9_39617553), object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:184)
  at Smarty_Internal_Runtime_Inheritance->process(object(Smarty_Internal_Template), object(Block_171969554661824a2fb5e9d9_39617553))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:156)
  at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(Smarty_Internal_Template), 'Block_171969554661824a2fb5e9d9_39617553', 'field', 0)
     (var/cache/dev/smarty/compile/7c/cc/af/7cccafd77d004e6fa87955b64636e3027a686ecd_0.file.form.tpl.php:1515)
  at Block_18964176761824a2fb041e8_84166521->callBlock(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:248)
  at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_18964176761824a2fb041e8_84166521), object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:184)
  at Smarty_Internal_Runtime_Inheritance->process(object(Smarty_Internal_Template), object(Block_18964176761824a2fb041e8_84166521))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:156)
  at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(Smarty_Internal_Template), 'Block_18964176761824a2fb041e8_84166521', 'input_row', 0)
     (var/cache/dev/smarty/compile/7c/cc/af/7cccafd77d004e6fa87955b64636e3027a686ecd_0.file.form.tpl.php:1674)
  at Block_100994086861824a2fac2934_96406321->callBlock(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:248)
  at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_100994086861824a2fac2934_96406321), object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:184)
  at Smarty_Internal_Runtime_Inheritance->process(object(Smarty_Internal_Template), object(Block_100994086861824a2fac2934_96406321))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:156)
  at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(Smarty_Internal_Template), 'Block_100994086861824a2fac2934_96406321', 'fieldset', 0)
     (var/cache/dev/smarty/compile/7c/cc/af/7cccafd77d004e6fa87955b64636e3027a686ecd_0.file.form.tpl.php:1840)
  at Block_29591128561824a2fa5a0b6_59597802->callBlock(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:248)
  at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_29591128561824a2fa5a0b6_59597802), object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:184)
  at Smarty_Internal_Runtime_Inheritance->process(object(Smarty_Internal_Template), object(Block_29591128561824a2fa5a0b6_59597802))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:156)
  at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(Smarty_Internal_Template), 'Block_29591128561824a2fa5a0b6_59597802', 'defaultForm')
     (var/cache/dev/smarty/compile/7c/cc/af/7cccafd77d004e6fa87955b64636e3027a686ecd_0.file.form.tpl.php:39)
  at content_61824a301d8e96_60602906(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
  at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
  at Smarty_Template_Compiled->render(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
  at Smarty_Internal_Template->render(false, 0)
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:232)
  at Smarty_Internal_TemplateBase->_execute(object(Smarty_Internal_Template), null, null, null, 0)
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:116)
  at Smarty_Internal_TemplateBase->fetch()
     (classes/helper/Helper.php:114)
  at HelperCore->generate()
     (classes/helper/HelperForm.php:314)
  at HelperFormCore->generate()
     (classes/helper/HelperForm.php:67)
  at HelperFormCore->generateForm(array(array('form' => array('tinymce' => true, 'description' => '...', 'submit' => array('name' => 'save', 'title' => 'Save', 'class' => 'button pull-right'), 'buttons' => array(array('href' => 'https://.../admin/index.php?controller=AdminEverPsBlogPost&token=488628d7936e00637b92d285b5efd109', 'title' => 'Cancel', 'icon' => 'process-icon-cancel')), 'input' => array(array('type' => 'hidden', 'name' => 'id_ever_post'), array('type' => 'select', 'label' => 'Associated categories', 'desc' => 'Please choose at least one category', 'hint' => 'Choose one or more categories', 'name' => 'post_categories[]', 'class' => 'chosen', 'identifier' => 'name', 'multiple' => true, 'options' => array('query' => array(array('id_ever_category' => '1', 'title' => 'Root', 'meta_title' => '', 'meta_description' => '...', 'link_rewrite' => 'root', 'content' => 'Root', 'bottom_content' => '', 'id_lang' => '1', 'id_parent_category' => '0', 'id_shop' => '1', 'date_add' => '2021-10-24 11:42:07', 'date_upd' => '2021-10-24 11:42:07', 'index' => '0', 'follow' => '0', 'sitemap' => '0', 'active' => '1', 'category_products' => '', 'is_root_category' => '1', 'count' => '0', 'featured_image' => 'https://...//img/logo-1635522847.jpg')), 'id' => 'id_ever_category', 'name' => 'title')), array('type' => 'select', 'label' => 'Default categories', 'desc' => 'Please choose default category', 'hint' => 'Will be used on breadcrumb', 'name' => 'id_default_category', 'options' => array('query' => array(), 'id' => 'id_ever_category', 'name' => 'title')), array('type' => 'select', 'label' => 'Associated tags', 'desc' => 'Please choose at least one tag', 'hint' => 'Choose one or more tags', 'name' => 'post_tags[]', 'class' => 'chosen', 'multiple' => true, 'options' => array('query' => array(), 'id' => 'id_ever_tag', 'name' => 'title')), array('type' => 'select', 'label' => 'Associated products', 'desc' => 'Please choose at least one product', 'hint' => 'Choose one or more product', 'name' => 'post_products[]', 'class' => 'chosen', 'multiple' => true, 'options' => array('query' => array(array('id_product' => '8', 'id_supplier' => '0', 'id_manufacturer' => '0', 'id_category_default' => '2', 'id_shop_default' => '1', 'id_tax_rules_group' => '0', 'on_sale' => '0', 'online_only' => '0', 'ean13' => '', 'isbn' => '', 'upc' => '', 'mpn' => '', 'ecotax' => '0.000000', 'quantity' => '0', 'minimal_quantity' => '1', 'low_stock_threshold' => null, 'low_stock_alert' => '0', 'price' => '29.000000', 'wholesale_price' => '5.350000', 'unity' => '', 'unit_price_ratio' => '0.000000', 'additional_shipping_cost' => '0.000000', 'reference' => '', 'supplier_reference' => '', 'location' => '', 'width' => '0.000000', 'height' => '0.000000', 'depth' => '0.000000', 'weight' => '0.000000', 'out_of_stock' => '2', 'additional_delivery_times' => '1', 'quantity_discount' => '0', 'customizable' => '0', 'uploadable_files' => '0', 'text_fields' => '0', 'active' => '0', 'redirect_type' => '404', 'id_type_redirected' => '0', 'available_for_order' => '1', 'available_date' => '0000-00-00', 'show_condition' => '0', 'condition' => 'new', 'show_price' => '1', 'indexed' => '0', 'visibility' => 'both', 'cache_is_pack' => '0', 'cache_has_attachments' => '0', 'is_virtual' => '0', 'cache_default_attribute' => '0', 'date_add' => '2021-10-25 16:07:18', 'date_upd' => '2021-10-26 17:58:20', 'advanced_stock_management' => '0', 'pack_stock_type' => '3', 'state' => '1', 'product_type' => '', 'id_shop' => '1', 'id_lang' => '1', 'description' => '...', 'description_short' => '...', 'link_rewrite' => 'black-tablecloth', 'meta_description' => '...', 'meta_keywords' => '', 'meta_title' => 'Black Indian style tablecloth', 'name' => 'Black tablecloth', 'available_now' => '', 'available_later' => '', 'delivery_in_stock' => '', 'delivery_out_stock' => '', 'manufacturer_name' => null, 'supplier_name' => null, 'rate' => 0.0, 'tax_name' => '')), 'id' => 'id_product', 'name' => 'name')), array('type' => 'select', 'label' => 'Author', 'desc' => 'Please choose post author', 'hint' => 'Else will be shop name', 'name' => 'id_author', 'options' => array('query' => null, 'id' => 'id_ever_author', 'name' => 'nickhandle')), array('type' => 'text', 'label' => 'Post meta title', 'desc' => 'Most of search engines do not accept more that 65 characters', 'hint' => 'Important for your SEO !', 'maxchar' => 65, 'required' => true, 'name' => 'meta_title', 'lang' => true, 'autoload_rte' => true, 'cols' => 60, 'rows' => 30), array('type' => 'text', 'label' => 'Post meta description', 'desc' => 'Most of search engines do not accept more that 165 characters', 'hint' => 'Important for your SEO !', 'maxchar' => 165, 'required' => true, 'name' => 'meta_description', 'lang' => true, 'autoload_rte' => true, 'cols' => 60, 'rows' => 30), array('type' => 'text', 'label' => 'Post link rewrite', 'desc' => 'For rewrite rules, required for SEO', 'hint' => 'Will set post base URL', 'required' => true, 'name' => 'link_rewrite', 'class' => 'copy2friendlyUrl', 'lang' => true, 'autoload_rte' => true, 'cols' => 60, 'rows' => 30), array('type' => 'text', 'label' => 'Post title', 'desc' => 'Add here post title', 'hint' => 'Will be shown on each pages', 'required' => true, 'name' => 'title', 'lang' => true, 'autoload_rte' => true, 'cols' => 60, 'rows' => 30), array('type' => 'textarea', 'label' => 'Post content', 'desc' => 'Add here post content', 'hint' => 'Will be shown on each pages', 'required' => true, 'name' => 'content', 'lang' => true, 'autoload_rte' => true, 'cols' => 60, 'rows' => 30), array('type' => 'textarea', 'label' => 'Post excerpt', 'desc' => 'Add here post excerpt', 'hint' => 'Will be shown on listings', 'required' => true, 'name' => 'excerpt', 'lang' => true, 'autoload_rte' => false, 'cols' => 60, 'rows' => 30), array('type' => 'file', 'label' => 'Post image', 'desc' => 'Will be shown on post top', 'hint' => 'Useful for sharing on social medias', 'name' => 'post_image', 'display_image' => true, 'required' => true, 'image' => '<image src="https://..." style="max-width:150px;"/>'), array('type' => 'switch', 'label' => 'SEO index post ?', 'desc' => 'Set yes to index, no to noindex', 'hint' => 'Else post won\'t be available on Google', 'name' => 'index', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => 'Yes'), array('id' => 'active_off', 'value' => 0, 'label' => 'No'))), array('type' => 'switch', 'label' => 'SEO follow post ?', 'desc' => 'Set yes to follow, no to nofollow', 'hint' => 'Nofollow will block search engines from following links on this post', 'name' => 'follow', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => 'Yes'), array('id' => 'active_off', 'value' => 0, 'label' => 'No'))), array('type' => 'switch', 'label' => 'SEO sitemap post ?', 'desc' => 'Set yes to sitemap, no to nositemap', 'hint' => 'Please generate sitemaps after changing this rule', 'name' => 'sitemap', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => 'Yes'), array('id' => 'active_off', 'value' => 0, 'label' => 'No'))), array('type' => 'datetime', 'label' => 'Date add', 'desc' => 'Add here post date', 'hint' => 'Default date add will date post has been created', 'required' => true, 'name' => 'date_add', 'lang' => false, 'cols' => 60, 'rows' => 30), array('type' => 'select', 'label' => 'Post status', 'desc' => 'Select if published, draft or more', 'hint' => 'Pending is "waiting for review"', 'name' => 'post_status', 'options' => array('query' => array(array('id_status' => 'draft', 'name' => 'draft'), array('id_status' => 'pending', 'name' => 'pending'), array('id_status' => 'published', 'name' => 'published'), array('id_status' => 'trash', 'name' => 'trash'), array('id_status' => 'planned', 'name' => 'planned')), 'id' => 'id_status', 'name' => 'name')))))))
     (modules/everpsblog/controllers/admin/AdminEverpsBlogPostController.php:767)
  at AdminEverPsBlogPostController->renderForm()
     (classes/controller/AdminController.php:2195)
  at AdminControllerCore->initContent()
     (classes/controller/Controller.php:306)
  at ControllerCore->run()
     (classes/Dispatcher.php:518)
  at DispatcherCore->dispatch()
     (admin/index.php:93)

Trace for Author Adding:

Author Error
Symfony\Component\Debug\Exception\ContextErrorException:
Notice: Trying to access array offset on value of type null

  at modules/everpsblog/controllers/admin/AdminEverPsBlogAuthorController.php:337
  at AdminEverPsBlogAuthorController->renderForm()
     (classes/controller/AdminController.php:2195)
  at AdminControllerCore->initContent()
     (classes/controller/Controller.php:306)
  at ControllerCore->run()
     (classes/Dispatcher.php:518)
  at DispatcherCore->dispatch()
     (admin/index.php:93)
CySSoO commented 2 years ago

Hello @pankajpatel and thank you for your interest in our module ! Can you grab the following version : https://github.com/TeamEver/everpsblog/archive/refs/tags/V5.3.18.zip And tell us if that solves your concern? The modification is accessible on this commit : https://github.com/TeamEver/everpsblog/commit/afc89b5722e73757062f50f498396fa8ce537c6e

pankajpatel commented 2 years ago

Doesn't seem to be working. Now, adding the Author also shows the same error as adding Post.

in modules/everpsblog/controllers/admin/AdminEverPsBlogAuthorController.php (line 617)

And

in modules/everpsblog/controllers/admin/AdminEverpsBlogPostController.php (line 765)
CySSoO commented 2 years ago

Hello @pankajpatel I just made a correction on the authors and posts. You can view the modified code on this commit: https://github.com/TeamEver/everpsblog/commit/6fe093c6c3e01cba5d08183148247802c24aa587 Does this solve your concern? Sorry, I have a little trouble reproducing but I think I found the origin of this problem You can retrieve the latest version of the module on this tag: https://github.com/TeamEver/everpsblog/archive/refs/tags/V5.3.19.zip

pankajpatel commented 2 years ago

@CySSoO Sorry for the late update but this update also didn't fix the issue.

Unfortunately, I had to uninstall the module as the note to update the module was not going away even if I have the latest one installed