This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

aroca

  • *
  • 1 posts
ERROR When no picture added
« on: April 29, 2016, 06:25:35 AM »
Error when no picture added (we tested if user will not add picture)

ERROR:
Warning: Illegal string offset 'name' in /xx/xx/public_html/xx/oc-content/plugins/image_required/index.php on line 78

Warning: Cannot modify header information - headers already sent by (output started at /xx/xx/public_html/xx/oc-includes/osclass/utils.php:1740) in /xx/xx/public_html/xx/oc-includes/osclass/utils.php on line 1745


Line 78
    $img_uploading = count($aItem['photos']['name']);


Lines 1738-1748
function osc_redirect_to($url, $code = null) {
    if(ob_get_length()>0) {
        ob_end_flush();
    }
    if($code!=null) {
        header("Location: ".$url, true, $code);
    } else {
        header("Location: ".$url);
    }
    exit;
}


What to do? Thank you!
NOTE: No problem if with picture :))

*

MB Themes

Re: ERROR When no picture added
« Reply #1 on: April 29, 2016, 06:54:59 AM »
@aroca
Well that is interesting, as PHP control should never be activated on site without errors.
Unfortunately I cannt get such problem, please PM me login to your FTP and your URL so I can investigate what is issue.

Thanks
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

sachinthana

  • **
  • 8 posts
Re: ERROR When no picture added
« Reply #2 on: June 11, 2016, 11:00:20 AM »
same issue on my site.

Warning: Illegal string offset 'name' in #/oc-content/plugins/image_required/index.php on line 78

Warning: Cannot modify header information - headers already sent by (output started at #/oc-includes/osclass/utils.php:1740) in #/oc-includes/osclass/utils.php on line 1745

please solve this issue.

*

MB Themes

Re: ERROR When no picture added
« Reply #3 on: June 11, 2016, 08:09:21 PM »
@sachinthana
As I cannot replicate problem, PM me login to your ftp & oc-admin.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on June 13, 2016, 12:17:29 PM
*

MB Themes

Re: ERROR When no picture added
« Reply #4 on: June 13, 2016, 12:15:42 PM »
@aroca, @sachinthana
I think I have identified problem.
To fix, please go to file:
oc-content/plugins/image_required/index.php

Find code (there are 2 occurences):
Code: [Select]
    $img_uploading = count($aItem['photos']['name']);
    $img_count = $img_exists + $img_uploading;

Replace with (both of them):
Code: [Select]
    if(array_key_exists('name', $aItem['photos'])) {
      $img_uploading = count($aItem['photos']['name']);
      $img_count = $img_exists + $img_uploading;
    } else {
      $img_count = 0;
    }
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots