Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Fastcgi Sent In Stderr: "php Message: Php Warning: Illegal String Offset Rate Topic   - - - - -

 
  • tigerbabba
  • Member
  • Members
  • Join Date: 26-Apr 08
  • 257 posts

Posted 06 June 2017 - 01:47 PM #1

Hello I am getting the following WARNING 
 
2017/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 380
 
   my LINE 380 is as follows
 
        if (empty($discussion) || ($discussion['type'] != 'R' && $discussion['type'] != 'B')) {

 


Currently using CS-Cart 4.x
Fortigate Firewalls

 
  • beencart
  • Senior Member
  • Authorized Reseller
  • Join Date: 27-Feb 17
  • 191 posts

Posted 06 June 2017 - 04:57 PM #2

 

Hello I am getting the following WARNING 
 
2017/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 380
 
   my LINE 380 is as follows
 
        if (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'))) {


 
  • tigerbabba
  • Member
  • Members
  • Join Date: 26-Apr 08
  • 257 posts

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);

Currently using CS-Cart 4.x
Fortigate Firewalls

 
  • beencart
  • Senior Member
  • Authorized Reseller
  • Join Date: 27-Feb 17
  • 191 posts

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);
}


 
  • ThomH
  • Senior Member
  • Members
  • Join Date: 20-Nov 07
  • 1681 posts

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