Osclass Support Forums

Osclass plugin support => Online Chat Plugin => Topic started by: slicer on February 03, 2018, 03:10:07 AM

Title: Bug with preview items Stela
Post by: slicer on February 03, 2018, 03:10:07 AM
Hey @frosticek I found a bug, Online Chat Plugin+Stela Theme.

if you enable Live Chat and clic Preview in the Ad the fuction crashes.

Here is the console error on chrome:
Code: [Select]
Uncaught ReferenceError: ocUserId is not defined
    at HTMLDocument.<anonymous> (user.js:297)
    at k (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at Function.ready (jquery.min.js:2)
    at HTMLDocument.D (jquery.min.js:2)

This screen is from a clean installation you can reproduce at your end

(https://i.imgur.com/itpyiZU.jpg)


Have a good one!
Title: Re: Bug with preview items Stela
Post by: MB Themes on February 05, 2018, 11:30:41 AM
@slicer
Go to file:
oc-content/plugins/online_chat/js/user.js

to line #2 add code:
Code: [Select]
  if (typeof ocUserId === 'undefined') {
    var ocUserId = 0;
  }
Title: Re: Bug with preview items Stela
Post by: slicer on February 05, 2018, 10:12:05 PM
@slicer
Go to file:
oc-content/plugins/online_chat/js/user.js

to line #2 add code:
Code: [Select]
  if (typeof ocUserId === 'undefined') {
    var ocUserId = 0;
  }

Sry It still not working

Here is the final code I got on oc-content/plugins/online_chat/js/user.js
Code: [Select]
$(document).ready(function(){
 if (typeof ocUserId === 'undefined') {
    var ocUserId = 0;
  }


RESULTS:

(https://i.imgur.com/lJElaRZ.jpg)

CONSOLE:
(https://i.imgur.com/In4VBJ1.jpg)





Title: Re: Bug with preview items Stela
Post by: MB Themes on February 05, 2018, 10:15:22 PM
Code: [Select]
  if (typeof ocUserId === undefined) {
    var ocUserId = 0;
  }


try it like this...
Title: Re: Bug with preview items Stela
Post by: slicer on February 06, 2018, 01:49:27 AM
Code: [Select]
  if (typeof ocUserId === undefined) {
    var ocUserId = 0;
  }


try it like this...

Same results!  :P   Same error in console!  ;D
Title: Re: Bug with preview items Stela
Post by: MB Themes on February 06, 2018, 08:23:58 AM
@slicer (have you cleaned cache of it?)
Ok, in index.php
Code: [Select]
osc_add_hook('footer', 'oc_js');
change to:
Code: [Select]
osc_add_hook('header', 'oc_js');
Title: Re: Bug with preview items Stela
Post by: slicer on February 06, 2018, 02:49:24 PM
YES flawlessly ^_^ and I was clearing all data in browser just in case.