Announcement

Collapse
No announcement yet.

Users getting script error in WYSIWYG Interface

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • fishindex
    replied
    Ahhh...*light goes on*...OK - I see what you're doing - I searched the 3.01 sources and found the dynamic onload event setup for editInit() in functions_editor.php in the DOTOOLBAR conditional. So, just for the benefit of others reading this thread, the way it works is that when someone opens up the editor window, an onload=editInit(); is automatically inserted in the body tag of the editor's html (or whatever is using the toolbar, I guess), which should invoke the correct javascript initialization.

    Fair enough - so I checked my standard edit body tag by viewing the page source, and oddly enough, the onload=editInit(); is where it is supposed to be, so it seems like it should have worked, right? But no!

    We include the vb3 forums beneath a custom navigation panel which already has its own set of DHTML menus (with onload code) and its own body tag (with no onload event, however) and all of it gets loaded before vb, as SM suggests, from the header include in vb. When you dump the HTML for the page, there are 2 body tags, but only the 2nd vb <body> has an onload event. However, it's possible that the DHTML is stealing the event, or the browser is processing it for the "wrong" body tag.

    I'm not exactly sure what to do about this, other than the earlier fix, or adding vb's call to editInit() in our body tag, which would not be a very self-contained or clean way to address the problem, especially since it would be called on every page, rather than the targeted std. editor page.

    Also, since my post with the code fix above, I have had confirmation from everyone previously getting javascript errors that the problems are now resolved. They're happy, so I'm happy.

    So...does this extra info help? It looks like you might need to account for other things stealing your onload event or body tag out from under you. If there's anything else I can do, let me know. I probably don't need to rip out all the live forum changes - it's easy to see that it will work similar to what you saw in your testing, based on looking at the code and html dump.

    Leave a comment:


  • Scott MacVicar
    replied
    editInit should be in the onload for the body tag. Have you edited the header at all?

    the reason for this is IE wont execute the editInit until after everything up to that point is loaded where other browsers would execute that before images before it were fully loaded, hence the reason for the call only to IE.

    I just tried all 3 editors in FireFox, IE and Opera without problem. Clicking smilies etc. All had the hovering ability though it was indeed broken when I removed the onload event. This is usually caued by drop down menu scripts.

    Leave a comment:


  • fishindex
    replied
    This is a vBulletin bug present in v3.01 as upgraded from 2.x.x. The problem is that you are failing to call editInit() for IE browsers in the editor_toolbar_standard template with the following code:

    Code:
     
    <if condition="is_browser('ie')">
    <!-- initialization script -->
    <script type="text/javascript">
    <!--
    editInit();
    //-->
    </script>
    </if>
    [NOTE: to fix the problem, add the above code to the bottom of editor_toolbar_standard]

    I saw the same problem and did an upgrade from vb2.3.5 to vb3.0.1 and my editor_toolbar_standard template was unmodified.

    I hope this helps resolve the issue, since CTL+F5 will not work to fix this problem. So far, after adding the appropriate js init code to standard template, it seems to be working.

    Also, in your respective editor clientscript files, "theform" is the name of the variable you set to document.forms.vbform in vbcode_init(), called by editInit(), which is why the browser reports that the theform.whatever is invalid, since it is uninitialized.

    As above, this may be an artifact of the v2.x.x update process, since it did not happen in my other site, which was a clean 3.0RC-based install. Is there a problem with the installer?

    Leave a comment:


  • NetAddition
    replied
    I'm getting the same wysiwyg smiley problem.

    I can use the drop down smileys on this forum, but they don't work on my own forum. I'm using vbulletin 3 gold.
    BTW everything did work ok to start with, but for some reason the wysiwyg smiley thing and font picker have stopped working.

    Never mind, i think i've fixed it.

    Here's how i fixed it :-
    http://netaddition.com/forums/showth...?p=207#post207
    Hope that helps.
    Last edited by NetAddition; Tue 13 Apr '04, 5:00am.

    Leave a comment:


  • Steve Machol
    replied
    Originally posted by Orfejs
    Even in Gold the same JS error - I can't use the GUI, nor attach files - what can I do?
    Please start your own ticket with all the relevant details needed to help understand and fix this problem.

    Leave a comment:


  • Orfejs
    replied
    Even in Gold the same JS error - I can't use the GUI, nor attach files - what can I do?

    Leave a comment:


  • Wayne Luke
    replied
    It is what is causing your users to get javascript errors. Each element accessed by javascript needs a valid name.

    You need to revert all your templates and not apply any hacks or modifications until you can verify that this works for all users.

    Leave a comment:


  • TrickyD
    replied
    Originally posted by Wayne Luke
    Why is your new post form named "theform"? if all the templates are up to date. The default form name for the post entry form is called "vbform" in the default templates.

    In fact the text "theform" doesn't occur anywhere in the default templates.

    You need to revert all your newpost templates including showthread.
    "theform" isn't something I would have knowingly added though because I have know idea what that means or what it is for. Is there any chance I messed something up in the upgarde to Release Canidate 4 and that is something from an older version?

    I honestly have no idea what that part is for so sorry if this is a strange question.

    Leave a comment:


  • TrickyD
    replied
    Ok, I just tried it with the default template (unmodified) and it worked just fine so it is obviously something I've messed up in modifying my styles.

    Here is the modification I made to the postbit template. I removed post counts and added a custom field #5.

    Code:
    [size=2]
    <!-- user info -->
    
    <table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
    
    <tr>
    
    <if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurl" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
    
    <td nowrap="nowrap">
    
    
    
    <div id="postmenu_$post[postid]">
    
    <if condition="$show['profile']">
    
    <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
    
    $post[onlinestatus]
    
    <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
    
    <else />
    
    $post[musername]
    
    </if>
    
    </div>
    
    
    
    <if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
    
    <if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
    
    
    
    </td>
    
    <td width="100%">&nbsp;</td>
    
    <td valign="top" nowrap="nowrap">
    
    
    
    <div class="smallfont">
    
    <if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
    
    <if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
    
    <if condition="$post['field5']"><div>Favorite Team: $post[field5]</div></if>
    
    <if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
    
    <div>
    
    <if condition="$show['reputation']">$post[reputationdisplay]</if>
    
    </div>
    
    <div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>
    
    </div>
    
    
    
    </td>
    
    </tr>
    
    </table>
    
    <!-- / user info -->[/size]
    Code:
    [size=2]
    <!-- / controls below postbits -->
    
    <br />
    
    <!-- Manual NavBar -->
    
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    
    <tr>
    
    <td class="alt1" width="100%">
    
    <if condition="is_array($navbits)">
    
    <table cellpadding="0" cellspacing="0" border="0">
    
    <tr valign="bottom">
    
    <td><a href="#" onclick="history.back(1)"><img src="$stylevar[imgdir_misc]/navbits_start.gif" alt="$vbphrase[go_back]" border="0" /></a></td>
    
    <td>&nbsp;</td>
    
    <td width="100%"><span class="navbar"><a href="$vboptions[forumhome].php?$session[sessionurl]">$vboptions[bbtitle]</a></span> $navbits[breadcrumb]</td>
    
    </tr>
    
    <tr>
    
    <td class="navbar" style="font-size:10pt; padding-top:1px" colspan="3"><a href="$scriptpath"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink.gif" alt="$vbphrase[reload_this_page]" border="0" /></a> <strong>$navbits[lastelement]</strong></td>
    
    </tr>
    
    </table> 
    
    <else />
    
    <div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php?$session[sessionurl]"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
    
    </if>
    
    </td> 
    
    </table>
    
    <!-- / Manual NavBar -->
    
    <div class="smallfont" align="center">
    
    <strong>&laquo;</strong>
    
    <a href="showthread.php?$session[sessionurl]t=$threadid&amp;goto=nextoldest">$vbphrase[prev_thread]</a>
    
    |
    
    <a href="showthread.php?$session[sessionurl]t=$threadid&amp;goto=nextnewest">$vbphrase[next_thread]</a>
    
    <strong>&raquo;</strong>
    
    </div>
    
    <br />
    
    $quickreply
    I also added the modification in the "how do I" forum that makes signature only appear once per page.
     
    I added the following directly above the Quick Reply function to allow quick navigation at the bottom of threads.
     
    

    Did I make any obvious mistakes in either of those?
    [/size]

    Leave a comment:


  • Wayne Luke
    replied
    Why is your new post form named "theform"? if all the templates are up to date. The default form name for the post entry form is called "vbform" in the default templates.

    In fact the text "theform" doesn't occur anywhere in the default templates.

    You need to revert all your newpost templates including showthread.
    Last edited by Wayne Luke; Tue 9 Mar '04, 6:03pm.

    Leave a comment:


  • TrickyD
    replied
    Originally posted by Steve Machol
    What is the URL to your forums? Are you runing any modifed templates or files?

    Try this. Run 'Find Updated Templates' and revert all the templates it finds. Then run 'Suspect File Version' in Diagnostics and report back the results.
    Here is the link. http://dynamic6.gamespy.com/~ncaautopia/forums/

    I can give you a temporary ID and password if you would like to check it out more in depth as I have it set to moderate all new members.

    I did modify the; header, postbit and SHOWTHREAD templates and I did that before making those modified styles live so I haven't troubleshooted to see if the default template still works. I will check that in a minute and report back.

    Find Updated Templates told me that "All templates are up to date"

    I have attached the screenshot of the diagnostic report. Nothing on there says Release Canidate 4 so maybe I did mess something up there, but I'll wait for you to tell me anything as far as that goes I've got no idea.

    Thanks for helping out.

    Leave a comment:


  • Steve Machol
    replied
    What is the URL to your forums? Are you runing any modifed templates or files?

    Try this. Run 'Find Updated Templates' and revert all the templates it finds. Then run 'Suspect File Version' in Diagnostics and report back the results.

    Leave a comment:


  • TrickyD
    replied
    Originally posted by Steve Machol
    The solution is almost certainly what Wayne posted abouve - they are getting a cached version of the js file. Depending on which browsers they are using they may need to empty their browser cache.
    Originally posted by Wayne Luke
    They also need to be identifying their browser properly. If they try to masquerade as Internet Explorer, they will get errors because the javascript relies heavily on a truthful representation of browser.
    After another day of asking questions and such and experimenting myself, I'm certain this is not the case.

    Every member of the forum using the Standard editor can not post a smiley or use any of the WYSIWYG functions without receiving the script error I have attached to this post.

    I tried it myself, I switched to the Standard editor, used CTRL+F5, cleaned out my temporary internet files and cookies and went back and I too received the script error. I have no other browsers other than IE installed.

    Again, the problem goes away as soon as any of the users switch to the enhanced editor.

    Anymore ideas?
    Attached Files

    Leave a comment:


  • Floris
    replied
    That was done correctly then.

    Goto 'find updated templates' and see if it says any there. If not: then you should be fine.

    Leave a comment:


  • TrickyD
    replied
    Thanks for the replies. I'm not positive of the computer literacy of the forum members that are having the problems, but they do claim the CTRL+F5 is having no results. I haven't heard back from them yet on whether or not they also have other browsers running though.

    What would be the significance of the script errors only occurring on the standard toolbar and not the enhanced version? Just for curiosities sake.

    It would also help if you build a new style based on the latest templates rather then use the ones from the previous versions.
    I believe I did do that, I clicked "Add new Style" and did not base it off any parent style. Would that have based it off of the latest templates? I assumed it would, but didn't know for sure.

    Leave a comment:

Loading...
Working...
X