MyBB Community Forums

Full Version: jquery after update 1810 to 1825
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello:

Excuse my english, I`m spanish.  

In our forum we have problems with jquery and dropdown after updating from version 1.8.10 to 1.8.25.  It is sure that it is because of our MyBB pro theme but we don't know how to fix it.  

This is the error log


jquery.js?ver=1821:2 Uncaught Error: Syntax error, unrecognized expression: #
at Function.se.error (jquery.js?ver=1821:2)

    at se.tokenize (jquery.js?ver=1821:2)
    at se.select (jquery.js?ver=1821:2)
    at Function.se [as find] (jquery.js?ver=1821:2)
    at S.fn.init.find (jquery.js?ver=1821:2)
    at new S.fn.init (jquery.js?ver=1821:2)
    at S (jquery.js?ver=1821:2)
    at i (bootstrap.min.js:11)
    at HTMLSpanElement.r.toggle (bootstrap.min.js:11)
    at HTMLDocument.dispatch (jquery.js?ver=1821:2)
se.error @ jquery.js?ver=1821:2
se.tokenize @ jquery.js?ver=1821:2
se.select @ jquery.js?ver=1821:2
se @ jquery.js?ver=1821:2
find @ jquery.js?ver=1821:2
S.fn.init @ jquery.js?ver=1821:2
S @ jquery.js?ver=1821:2
i @ bootstrap.min.js:11
r.toggle @ bootstrap.min.js:11
dispatch @ jquery.js?ver=1821:2
v.handle @ jquery.js?ver=1821:2



[attachment=43916]



[attachment=43917]


headerinclude template

<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1810"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1810"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1810"></script>
<link rel="stylesheet" href="{$mybb->asset_url}/images/MyBBPro/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/octicons/2.0.2/octicons.min.css" />

<script src="{$mybb->asset_url}/images/MyBBPro/bootstrap/js/bootstrap.min.js"></script>
<script src="{$mybb->asset_url}/images/MyBBPro/all.js"></script>
{$avatarep_script}{$stylesheets}
<script type="text/javascript">
<!--
	lang.unknown_error = "{$lang->unknown_error}";

	lang.select2_match = "{$lang->select2_match}";
	lang.select2_matches = "{$lang->select2_matches}";
	lang.select2_nomatches = "{$lang->select2_nomatches}";
	lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
	lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
	lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
	lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
	lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
	lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
	lang.select2_loadmore = "{$lang->select2_loadmore}";
	lang.select2_searching = "{$lang->select2_searching}";

	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var cookieSecureFlag = "{$mybb->settings['cookiesecureflag']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var rootpath = "{$mybb->settings['bburl']}";
	var imagepath = "{$theme['imgdir']}";
  	var yes_confirm = "{$lang->yes}";
	var no_confirm = "{$lang->no}";
	var MyBBEditor = null;
	var spinner_image = "{$theme['imgdir']}/spinner.gif";
	var spinner = "<img src='" + spinner_image +"' alt='' />";
// -->
</script>{$avatarep_script}{$stylesheets}{$myprofile_headerinclude}{$myalerts_js}



header_welcomeblock_guest

<div class="dropdown">
  <span id="User-dropdown" role="button" data-toggle="dropdown" data-target="#">
    	<img src="images/defaultavatar.png" alt="Invitado" class="avatar" />
    	Hola Invitado
  </span>
  <ul class="dropdown-menu" role="menu" aria-labelledby="User-dropdown">
    	<li><a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true }); return false;" class="login">{$lang->welcome_login}</a></li>
    	<li><a href="{$mybb->settings['bburl']}/member.php?action=register" class="register">{$lang->welcome_register}</a></li>
  </ul>
</div>
				<div class="modal" id="quick_login" style="display: none;">
					<form method="post" action="{$mybb->settings['bburl']}/member.php">
                                                                   <input name="my_post_key" type="hidden" value="{$mybb->post_code}" />
						<input name="action" type="hidden" value="do_login" />
						<input name="url" type="hidden" value="" />
						<input name="quick_login" type="hidden" value="1" />
						<table width="100%" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" border="0" class="tborder">
							<tr>
								<td class="thead" colspan="2"><strong>{$lang->login}</strong></td>
							</tr>
							<tr>
								<td class="trow1" width="25%"><strong>{$login_username}</strong></td>
								<td class="trow1"><input name="quick_username" id="quick_login_username" type="text" value="" class="textbox initial_focus" /></td>
							</tr>
							<tr>
								<td class="trow2"><strong>{$lang->password}</strong></td>
								<td class="trow2">
									<input name="quick_password" id="quick_login_password" type="password" value="" class="textbox" /><br> <a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="lost_password">{$lang->lost_password}</a>
								</td>
							</tr>
							<tr>
								<td class="trow1">&nbsp;</td>
								<td class="trow1 remember_me">
									<input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" />
									<label for="quick_login_remember">{$lang->remember_me}</label>
								</td>
							</tr>
							<tr>
								<td class="trow2" colspan="2">
									<div align="center"><input name="submit" type="submit" class="button" value="{$lang->login}" /></div>
								</td>
							</tr>
						</table>
					</form>
				</div>
				<script type="text/javascript">
					$("#quick_login input[name='url']").val($(location).attr('href'));
				</script>



As we have this problem, we have returned to the previous version. We have created another forum (forum2) for testing with the updated version but we cannot find how to solve the problem. Could someone help us please?


The URL  official forum in mybb 1.8.10   : www.altoconsejojedi.es/foro

The URL  for testing in mybb 1.8.25       :  www.altoconsejojedi.es/foro2

User y password for testing:  for private message, 

Thanks
There was a major jump on jQuery versions from 1.x to 3.x in-between 1.8.10 and 1.8.25

I noticed you are using Bootstrap v3 whereas newest major version is 5, so I think this might be related to the issues you are finding (incompatibilities between Boostrap v3 and jQuery 3.x)

JavaScript isn't my forte (specially Boostrap) so you might be better waiting for someone else to assist you.
Muchas gracias, esperaré ayuda, no podemos solucionar ese error y tenemos que hacerlo para poder actualizar porque el tema que usamos está altamente optimizado y hacer uno nuevo sería mucho trabajo.
Intenta actualizar las librerías JS que utiliza el estilo (Boostrap, etc).

Ya que tienes 2 foros, puedes intentar en ambos, para ver si falla lo mismo en ambos o no.
Gracias nuevamente por su respuesta.

El problema es que no sabemos cómo hacerlo

En headerinclude cambia:
<script src="{$mybb->asset_url}/images/MyBBPro/bootstrap/js/bootstrap.min.js"></script>

A:
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>

O por el siguiente solo si el anterior no funciona:
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js" integrity="sha384-LtrjvnR4Twt/qOuYxE721u19sVFLVSA4hf/rRt6PrZTmiPltdZcI7q7PXQBYTKyf" crossorigin="anonymous"></script>

En los 2 estilos (1.8.10 y 1.8.25), luego verifica si algo dejo de funcionar.
Thanks again for your help.  Thanks, your second option works and does not show an error message.


But now there is a problem with the login box.

See how it shows. You can see it in the test forum in version 1.8.25 www.altoconsejojedi.es/foro2

[attachment=43935]


Regards.
(2021-03-14, 10:08 AM)pedrag2 Wrote: [ -> ]Thanks again for your help.  Thanks, your second option works and does not show an error message.


But now there is a problem with the login box.

See how it shows.  You can see it in the test forum in version 1.8.25    www.altoconsejojedi.es/foro2




Regards.

Hola, añadele
z-index: 1;
position: absolute;

[Image: f_4d4f8c1c20ef.png]
(2021-03-14, 01:12 PM)Hola, añadele Wrote: [ -> ]
z-index: 1;
position: absolute;

[Image: f_4d4f8c1c20ef.png]

Thanks for your help, they have been very satisfactory.

Now we will test the rest of the forum operation to see if there are any more bugs before updating to version 1.8.25.

Regards.