Posted by aruntvla on January 24, 2013 at 11:11am
Hello Friends,
i have added a new media field to user profile , when i access this field in user profile form its not working . this field is working in admin side and displaying media browser pop-up. i dont know whether its due to my custom theme .
following are the Jquery errors showing when page load and media button click ,
TypeError: j is undefined
[Break On This Error]
...moveChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase(...
TypeError: this.hoverable is undefined
[Break On This Error]
this.hoverable.removeClass( "ui-state-hover" ); code to display the field is :
<div class="checkboxfirst"><?php print render($form['field_upload_youtube_video']); ?></div>
the loaded javascript files are :
Comments
Are you using higher jQuery
Are you using higher jQuery version to custom theme?
There might be JS conflict issue.
-Imran
These are the javascript files loaded in header section
these are the javascript files loaded in header section , this jquery version included with drupal 7 , its not the latest jquery library , plz have a look on it.
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/jquery.js?v=1.4.4"></script><script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/jquery.once.js?v=1.2"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/drupal.js?mh4pzy"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.core.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.widget.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/media/js/media.core.js?v=7.x-1.2"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/media/js/util/json2.js?v=7.x-1.2"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/media/js/util/ba-debug.min.js?v=7.x-1.2"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.mouse.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.resizable.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.draggable.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.button.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.position.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/ui/jquery.ui.dialog.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/form.js?v=7.19"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/custom_alter/custom_alter.js?mh4pzy"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/fbconnect/fbconnect.js?mh4pzy"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/video/js/video.js?mh4pzy"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/themes/lifeecho/js/jquery-ui.js?mh4pzy"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/misc/textarea.js?v=7.19"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/date/date.js?mh4pzy"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/media/js/media.popups.js?v=7.x-1.2"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/sites/all/modules/media/js/media.js?mh4pzy"></script>
<script type="text/javascript" src="http://192.168.0.156:8022/LifeEcho/modules/user/user.js?mh4pzy"></script>
This is the diffchecker link
I have enabled core bartik theme its working fine , the issue is related with my custom theme 'lifeecho'.
This is the diffchecker link http://www.diffchecker.com/37Cyvhyw
Issue Resolved
The following function done the trick
/**
* Implementation of hook_js_alter().
*
* Swap out jQuery-ui to fix the media library issue from user profile page.
*/
function custom_alter_js_alter(&$javascript) {
if(arg(0) == 'user' && arg(2) == 'edit') { // check page is user edit profile page
unset($javascript['sites/all/themes/lifeecho/js/jquery-ui.js']);
}
}