iFrame Forum/WP error

xray
User ww
User ww
Posts: 30
Joined: Mon Dec 24, 2018 9:48 pm

iFrame Forum/WP error

Post by xray » Sat Feb 09, 2019 9:37 am

I am catching a couple of errors and a little confused on the fix. The errors appear in the wp-forum plugin

This is the error?
if ( href.charAt(0) == '#' && href.length == 1 || /^#[a-z0-9]+$/ig.exec(href) !== null && href.length < 8 ){


Uncaught TypeError: Cannot read property 'charAt' of undefined
at HTMLAnchorElement.<anonymous> (ucp.php?i=ucp_notifi…ication_options:991)
at HTMLDocument.dispatch (VM1826 jquery.min.js:3)
at HTMLDocument.r.handle (VM1826 jquery.min.js:3)
(anonymous) @ ucp.php?i=ucp_notifi…ication_options:991
dispatch @ VM1826 jquery.min.js:3
r.handle @ VM1826 jquery.min.js:3

User avatar
axew3
w3all User
w3all User
Posts: 1538
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame Forum/WP error

Post by axew3 » Sat Feb 09, 2019 10:32 am

if not wrong, on actual v3 js code, the unique line that contain this instruction is:

Code: Select all

if ( href.charAt(0) == '#' ){
and if the case, i've not check this, so i've not i've not understand the issue at moment and on what code you get in this: but so the it should just be in case:

Code: Select all

if ( typeof href !== 'undefined' && href.charAt(0) == '#' ){
while on latest mChat code, this code nor exist.
What code are you using?

What action/link you click to have this result?

Code mChat: viewtopic.php?f=2&t=904#p3397
Code v3 iframe: https://www.axew3.com/w3/2018/12/phpbb- ... iframe-v3/

xray
User ww
User ww
Posts: 30
Joined: Mon Dec 24, 2018 9:48 pm

Re: iFrame Forum/WP error

Post by xray » Sun Feb 10, 2019 2:06 am

Looks like this is a browser specific issue with push notifications within iFrame.

User avatar
axew3
w3all User
w3all User
Posts: 1538
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame Forum/WP error

Post by axew3 » Sun Feb 10, 2019 7:28 am

i now remember what this line has been changed in
it is now:

Code: Select all

// check for # short links like on FAQ page
if ( href.charAt(0) == '#' ){
 return;
}
the code line was in the way you report above, but it has been changed and reduced to this to be ok for any link like these (#).

The mChat code and css, has been moved to a separated file: so it can be changed to whatever needed, under any aspect, JS and/or CSS with easy. I will try to throw out the new plugin version within today if possible

xray
User ww
User ww
Posts: 30
Joined: Mon Dec 24, 2018 9:48 pm

Re: iFrame Forum/WP error

Post by xray » Sun Feb 10, 2019 9:29 pm

ok, that error is removed and this one pop-ups

Code: Select all

Uncaught TypeError: parent.w3all_ajaxup_from_phpbb is not a function
    at window.onload (mchat:1525)
window.onload @ mchat:1525
load (async)
(anonymous) @ mchat:1515

User avatar
axew3
w3all User
w3all User
Posts: 1538
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame Forum/WP error

Post by axew3 » Tue Feb 12, 2019 2:37 pm

ok, sorry little delay ... in trouble with an account swap into a site, that make me crazy between siteground cache and more mess ... wow ... last time i was feeling like a stupid, This time i'm feeling lost in the fog like a stupid ahahah ( but it's my birthday :o ... so it's ok )

this error can be resolved (also) in this way:

Code: Select all

if(parent.location.href.indexOf(wordpress_url_page_forum) > -1){
parent.w3all_ajaxup_from_phpbb(w3appendevents); 
}
the code not need to execute when not in page forum, because the js function
w3all_ajaxup_from_phpbb
come out on wp header html output, only on page forum (with code as is)

but the call to this function is done within overall_footer.html of phpBB, which is called on mchat instances, all over wp if mchat active, also when you're not on page forum.

little delay on releasing new plugin version.
I see any time something to add or improve and not going to the clue due to some other issue that come out maybe into a site i'm following.
Sorry again guys, doing my best in this little trouble days!

Just report, we'll fix!

User avatar
axew3
w3all User
w3all User
Posts: 1538
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame Forum/WP error

Post by axew3 » Tue Feb 12, 2019 2:49 pm

p.s The first version will be released maybe in this way but if i can i will improve immediately ... to not overload WP we can load mChat only when chat button clicked.
That's the right way. If an user isn't chatting, there is no need to overload the server in WP side with not useful mChat instances.
A nice preloader when chat button clicked will show: and mChat will load and so presented.
When Close Chat button clicked, the action should not only toggle the little chat window, but also close any active instance.

Post Reply