if (empty($discussion) || ($discussion['type'] != 'R' && $discussion['type'] != 'B')) {
Posted 06 June 2017 - 01:47 PM #1
if (empty($discussion) || ($discussion['type'] != 'R' && $discussion['type'] != 'B')) {
Posted 06 June 2017 - 04:57 PM #2
Hello I am getting the following WARNING2017/06/06 09:41:54 [error] 906#906: *94496 FastCGI sent in stderr: "PHP message: PHP Warning: Illegal string offset 'type' in /home/public_html/app/addons/discussion/func.php on line 380my LINE 380 is as followsif (empty($discussion) || ($discussion['type'] != 'R' && $discussion['type'] != 'B')) {
Hello! Replace it
if (empty($discussion) || ($discussion['type'] != 'R' && $discussion['type'] != 'B')) {
with this
if (empty($discussion) || (!empty($discussion['type']) && ($discussion['type'] != 'R' && $discussion['type'] != 'B'))) {
Posted 07 June 2017 - 11:36 AM #3
Thanks - That did fix that line error but after I implement your code I got another WARNING on line 383
$rating = db_get_field("SELECT AVG(a.rating_value) as val FROM ?:discussion_rating as a LEFT JOIN ?:discussion_posts as b ON a.post_id = b.post_id WHERE a.thread_id = ?i AND b.status = 'A' AND a.rating_value > ?i", $discussion['thread_id'], 0);
Posted 07 June 2017 - 11:49 AM #4
Thanks - That did fix that line error but after I implement your code I got another WARNING on line 383
$rating = db_get_field("SELECT AVG(a.rating_value) as val FROM ?:discussion_rating as a LEFT JOIN ?:discussion_posts as b ON a.post_id = b.post_id WHERE a.thread_id = ?i AND b.status = 'A' AND a.rating_value > ?i", $discussion['thread_id'], 0);
Make it as follows:
$rating = 0; if (!empty($discussion['thread_id'])) { $rating = db_get_field("SELECT AVG(a.rating_value) as val FROM ?:discussion_rating as a LEFT JOIN ?:discussion_posts as b ON a.post_id = b.post_id WHERE a.thread_id = ?i AND b.status = 'A' AND a.rating_value > ?i", $discussion['thread_id'], 0); }
Posted 07 June 2017 - 04:51 PM #5
The best way to fix it permanently is to post in the bug tracker.
WebGraphiq offers a wide range of professionally developed, ready to use CS-Cart add-ons to provide additional functionality and boost your sales. The oldest active CS-Cart add-on development team. -- Since 2006 --
CS-CART ADD-ONS | FREE QUOTE | CS-CART DEVELOPMENT | @webgraphiq