Using drupal 7.16 on Mac OSX 107, bitnami install. I have created a test page with just the following : [code] <DIV ID="content"></DIV> <a href="#" onclick="$('#content').load('http://localhost/cgi-bin/cgitest.py');">Take me away</a> [/code] When I click on the rendered link, I get the following javascript error: "Uncaught TypeError: undefined is not a function onclick" from Chrome.
Being a drupal noob but familiar with javascript issues in CGI programming, I infer that the jquery code for 'load' et al is not being sourced and that perhaps the correct module is not enabled?
I have derived this from the example shown at http://drupal.org/node/305747
NOTE : I have enabled the drupal ajax examples. None can illuminate this problem for me.
Any help would be appreciate: thanks
In Drupal 7, jQuery runs in no-conflict mode, so you can't use $ unless it's wrapped. Change $ to jQuery.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 11/13/2012 7:19 PM, Tim Johnson wrote:
Using drupal 7.16 on Mac OSX 107, bitnami install. I have created a test page with just the following : [code]
<DIV ID="content"></DIV> <a href="#" onclick="$('#content').load('http://localhost/cgi-bin/cgitest.py');">Take me away</a> [/code] When I click on the rendered link, I get the following javascript error: "Uncaught TypeError: undefined is not a function onclick" from Chrome.
Being a drupal noob but familiar with javascript issues in CGI programming, I infer that the jquery code for 'load' et al is not being sourced and that perhaps the correct module is not enabled?
I have derived this from the example shown at http://drupal.org/node/305747
NOTE : I have enabled the drupal ajax examples. None can illuminate this problem for me.
Any help would be appreciate: thanks
* Jamie Holly hovercrafter@earthlink.net [121113 15:42]:
In Drupal 7, jQuery runs in no-conflict mode, so you can't use $ unless it's wrapped. Change $ to jQuery.
:) You nailed it all right! Only problem now is that the cross-domain kicks in. Error message:
"XMLHttpRequest cannot load http://localhost/cgi-bin/cgitest.py. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin."
So, I copied cgitest.py to scripts and now the function call is [code] jQuery('#content').load('http://localhost:8080/drupal/scripts/cgitest.py');" [/code] now I get the entire file as content of the DIV : I.E. #!/usr/bin/python print "Content-Type: text/html\n\n" print "HELLO THERE" How do I capture the stdout only?
thanks for the quick reply
You need to set your server up to actually process python files. Doing so varies widely depending upon OS, server software and versions. You might want to Google for it or ask around on a forum dedicated to server configuration.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 11/13/2012 8:00 PM, Tim Johnson wrote:
- Jamie Holly hovercrafter@earthlink.net [121113 15:42]:
In Drupal 7, jQuery runs in no-conflict mode, so you can't use $ unless it's wrapped. Change $ to jQuery.
:) You nailed it all right! Only problem now is that the cross-domain kicks in. Error message:
"XMLHttpRequest cannot load http://localhost/cgi-bin/cgitest.py. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin."
So, I copied cgitest.py to scripts and now the function call is [code] jQuery('#content').load('http://localhost:8080/drupal/scripts/cgitest.py');" [/code] now I get the entire file as content of the DIV : I.E. #!/usr/bin/python print "Content-Type: text/html\n\n" print "HELLO THERE" How do I capture the stdout only?
thanks for the quick reply
* Jamie Holly hovercrafter@earthlink.net [121113 16:13]:
You need to set your server up to actually process python files. Doing so varies widely depending upon OS, server software and versions. You might want to Google for it or ask around on a forum dedicated to server configuration.
Wow! I've been a CGI programmer for 17 years and using python for CGI for 10 of that. Most certainly my server - I.E. apache, running on port 80 *is* configured to process python.
However the server in question in this case is drupal itself, running on port 8080.
Therefore, the question should be : How can I configure drupal to process python files?
thanks
* Tim Johnson tim@akwebsoft.com [121113 16:25]:
- Jamie Holly hovercrafter@earthlink.net [121113 16:13]:
You need to set your server up to actually process python files. Doing so varies widely depending upon OS, server software and versions. You might want to Google for it or ask around on a forum dedicated to server configuration.
Wow! I've been a CGI programmer for 17 years and using python for CGI for 10 of that. Most certainly my server - I.E. apache, running on port 80 *is* configured to process python.
However the server in question in this case is drupal itself, running on port 8080.
Therefore, the question should be : How can I configure drupal to process python files?
Actually, perhaps the question might be :
Am I using the correct jQuery function to actually read from the query response as written to stdout rather than loading the entire file content?
I've developed my own javascript resources over the years, so have never used jQuery and will research this.
Any further comments and/or solutions are welcome. thanks again
On 11/13/12 8:24 PM, Tim Johnson wrote:
- Jamie Holly hovercrafter@earthlink.net [121113 16:13]:
You need to set your server up to actually process python files. Doing so varies widely depending upon OS, server software and versions. You might want to Google for it or ask around on a forum dedicated to server configuration.
Wow! I've been a CGI programmer for 17 years and using python for CGI for 10 of that. Most certainly my server - I.E. apache, running on port 80 *is* configured to process python.
However the server in question in this case is drupal itself, running on port 8080.
Therefore, the question should be : How can I configure drupal to process python files?
thanks
Drupal is NOT a server, but a bunch of PHP scripts executed by your web server (possibly apache). It appears that you have configured your web server to listen on port 8080 and serve this port from a directory you have loaded Drupal into. THAT instance of the web server needs to be configured to run the CGI programs you want.
* Richard Damon Richard@Damon-Family.org [121113 17:02]:
On 11/13/12 8:24 PM, Tim Johnson wrote:
- Jamie Holly hovercrafter@earthlink.net [121113 16:13]:
You need to set your server up to actually process python files. Doing so varies widely depending upon OS, server software and versions. You might want to Google for it or ask around on a forum dedicated to server configuration.
Wow! I've been a CGI programmer for 17 years and using python for CGI for 10 of that. Most certainly my server - I.E. apache, running on port 80 *is* configured to process python.
However the server in question in this case is drupal itself, running on port 8080.
Therefore, the question should be : How can I configure drupal to process python files?
thanks
Drupal is NOT a server, but a bunch of PHP scripts executed by your web server (possibly apache). It appears that you have configured your web server to listen on port 8080 and serve this port from a directory you have loaded Drupal into. THAT instance of the web server needs to be configured to run the CGI programs you want.
Ah! My mistake!
I just let bitnami do the install. I did no configuration, but perhaps an option for port 80 was there in the setup interface. I would assume however that the apache instance would use the same configuration that the instance on port 80 does.
I believe that the jQuery.get() function may be what is needed. I will try it and report back tomorrow. thank you
On 11/13/12 9:33 PM, Tim Johnson wrote:
- Richard Damon Richard@Damon-Family.org [121113 17:02]:
On 11/13/12 8:24 PM, Tim Johnson wrote:
- Jamie Holly hovercrafter@earthlink.net [121113 16:13]:
You need to set your server up to actually process python files. Doing so varies widely depending upon OS, server software and versions. You might want to Google for it or ask around on a forum dedicated to server configuration.
Wow! I've been a CGI programmer for 17 years and using python for CGI for 10 of that. Most certainly my server - I.E. apache, running on port 80 *is* configured to process python.
However the server in question in this case is drupal itself, running on port 8080.
Therefore, the question should be : How can I configure drupal to process python files?
thanks
Drupal is NOT a server, but a bunch of PHP scripts executed by your web server (possibly apache). It appears that you have configured your web server to listen on port 8080 and serve this port from a directory you have loaded Drupal into. THAT instance of the web server needs to be configured to run the CGI programs you want.
Ah! My mistake!
I just let bitnami do the install. I did no configuration, but perhaps an option for port 80 was there in the setup interface. I would assume however that the apache instance would use the same configuration that the instance on port 80 does.
I believe that the jQuery.get() function may be what is needed. I will try it and report back tomorrow. thank you
Each virtual host in apache has its own configuration for many of the settings that apache uses, this is WHY you use multiple vhost, so you can change settings, like document root and CGI settings. Some settings can be set to replicate to all hosts/virtual hosts on the system, but settings define within one host don't copy to others.
If you had installed Drupal into the host of localhost:80, then it would use the settings for that host. This would have required you installing Drupal in your base document root. It appears that you told the system you wanted a new document root, so it created a new virtual host, on a different port, which means you need to configure it for all the options you need.
* Richard Damon Richard@Damon-Family.org [121113 18:15]:
Each virtual host in apache has its own configuration for many of the settings that apache uses, this is WHY you use multiple vhost, so you can change settings, like document root and CGI settings. Some settings can be set to replicate to all hosts/virtual hosts on the system, but settings define within one host don't copy to others.
If you had installed Drupal into the host of localhost:80, then it would use the settings for that host. This would have required you installing Drupal in your base document root. It appears that you told the system you wanted a new document root, so it created a new virtual host, on a different port, which means you need to configure it for all the options you need.
Understood. And I have made some tweaks to httpd.conf without success Here's what I have : # for port 8080 <VirtualHost *:8080> DocumentRoot "/Users/http" ScriptAlias /cgi-bin/ "/Users/http/run/" ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Users/http/run/$1" <Directory "/Users/http/run"> AllowOverride None Options None Order allow,deny Allow from all </Directory> </VirtualHost> # end port 8080 These are the same settings as for the default (port 80) settings. However, something is still lacking. If I point my browser to http://localhost/cgi-bin/cgitest.py I get the output I expect. If I point my browser to http://localhost:8080/cgi-bin/cgitest.py I still get a Not Found error.
/usr/sbin/apachectl configtest gives me "Syntax OK" thanks
You might have to add a NameVirtualHost in your main apache config file (not in the VirtualHost section):
NameVirtualHost *:8080
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 11/14/2012 1:12 PM, Tim Johnson wrote:
- Richard Damon Richard@Damon-Family.org [121113 18:15]:
Each virtual host in apache has its own configuration for many of the settings that apache uses, this is WHY you use multiple vhost, so you can change settings, like document root and CGI settings. Some settings can be set to replicate to all hosts/virtual hosts on the system, but settings define within one host don't copy to others.
If you had installed Drupal into the host of localhost:80, then it would use the settings for that host. This would have required you installing Drupal in your base document root. It appears that you told the system you wanted a new document root, so it created a new virtual host, on a different port, which means you need to configure it for all the options you need.
Understood. And I have made some tweaks to httpd.conf without success Here's what I have : # for port 8080 <VirtualHost *:8080> DocumentRoot "/Users/http" ScriptAlias /cgi-bin/ "/Users/http/run/" ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Users/http/run/$1" <Directory "/Users/http/run"> AllowOverride None Options None Order allow,deny Allow from all </Directory> </VirtualHost> # end port 8080 These are the same settings as for the default (port 80) settings. However, something is still lacking. If I point my browser to http://localhost/cgi-bin/cgitest.py I get the output I expect. If I point my browser to http://localhost:8080/cgi-bin/cgitest.py I still get a Not Found error.
/usr/sbin/apachectl configtest gives me "Syntax OK" thanks
* Jamie Holly hovercrafter@earthlink.net [121114 10:26]:
You might have to add a NameVirtualHost in your main apache config file (not in the VirtualHost section):
NameVirtualHost *:8080
Hi Jamie : I tried that. tested apache and got "Syntax OK", but no change.
BTW: checking the logs, I see that no logs are written from the 8080 instance.
I'm on the Apache ML also and they are offering some help, but without logs, it is murkier. Thanks again
Hi,
I've had to up the version of Jquery I'm using to support a few newer modules. In the process this has broken code I'd written that has worked for a year. Assuming I haven't added a syntax error in looking at it... and it being really basic code... I wonder if someone has hit this in the past and has any clues...
Here is the code...
Yani
/** * Theme behaviours for zeropoint * Author: Yani */
//Global Vars var displayCode; var urlCode; var coment = '-doc'; var docUrl; var mediaUrl; var planStatus = new Object; planStatus.help == 'off'; var protect; //defined as object to be used a associative array for menu status var switch1;
(function($) { Drupal.behaviors.zeroPoint = { attach : function(context, settings) { //Drupal Jquery wrapper
alert('Got to scripts.js X3');
// Plan menu version 2 // run the default
$("'#item-20t':not(.z-processed)", context); //view plan & media { $('#item-20t', context).click(function() { manageBlocks('media'); }); $('#item-20t', context).addClass('z-processed'); }
$("'#item-40t':not(.z-processed)", context); //view author { $('#item-40t', context).click(function() { manageBlocks('author'); }); $('#item-40t', context).addClass('z-processed'); }
$("'#item-30t':not(.z-processed)", context); //view document in co-ment { $('#item-30t', context).click(function() { manageBlocks('document'); }); $('#item-30t', context).addClass('z-processed'); }
$("'#item-50t'':not(.z-processed)", context); //view survey { $('#item-50t', context).click(function() { manageBlocks('survey'); }); $('#item-50t', context).addClass('z-processed'); }
$("'#item-60t':not(.z-processed)", context); //view help { $('#item-60t', context).click(function() { $('.region-user2', context).css('margin-top', '200px'); $('.region-user2', context).css('margin-left', '-1025px'); manageBlocks('help'); }); $('#item-60t', context).addClass('z-processed'); }
// close button
$("'.x-close':not(.z-processed)", context); { $('.x-close', context).click(function() { if(switch1 == 'on') { $('.region-user2').hide(); planStatus.help = 'off'; switch1 = 'off'; alert('Turn off: ' + switch1); } else { $('.region-user2').hide(); switch1 = 'off'; planStatus.help = 'off'; alert('An error has occurred in selecting the help'); } }); $('.x-close', context).addClass('z-processed'); }
// menu actions for the plan list page
$("'#item-1t':not(.z-processed)", context); { $('#item-1b', context).hide(); $('#item-1t', context).hover(function() { $('#item-1b').show(); }, function() { $('#item-1b').hide(); }); $('#item-1t', context).addClass('z-processed'); }
$("'#item-3t':not(.z-processed)", context); { $('#item-3b', context).hide(); $('#item-3t', context).hover(function() { $('#item-3b').show(); }, function() { $('#item-3b').hide(); }); $('#item-3t', context).addClass('z-processed'); }
$("'#item-4b':not(.z-processed)", context); { $('#item-4b', context).hide(); $('#item-4t', context).hover(function() { $('#item-4b').show(); }, function() { $('#item-4b').hide(); }); $('#item-4b', context).addClass('z-processed'); }
$("'#item-5t':not(.z-processed)", context); //view help { $('.region-user2', context).hide(); $('.region-user2', context).css('margin-top', '+250px'); $('.region-user2', context).css('margin-left', '-5px');
//add a class to enable positioning in css
$('#item-5t', context).click(function() { if(switch1 == 'off' || !switch1) { $('.region-user2').show(); switch1 = 'on'; //alert('Turn on: ' + switch1); } else if(switch1 == 'on') { $('.region-user2').hide(); switch1 = 'off'; //alert('Turn off: ' + switch1); } else { alert('An error has occurred in selecting the help. Error 201'); }
});
$('#item-5t', context).addClass('z-processed'); }
// clean up for header image $("'#headimg':not(.z-processed)", context); { $('#headimg', context).hide(); $('#header', context).hide(); //menu, logo etc need for loading order $('#header', context).delay(200).show(); $('#headimg', context).fadeIn(1000); $('#headimg', context).addClass('z-processed'); }
// creation of video iframe $("'.video-plan':not(.z-processed)", context); { var myvideo = $('.field-name-field-video-url .field-item').html(); if(myvideo != null && $('.video-plan').length == 0) { //alert ('myvideo Var : ' + myvideo); $('.field-name-body', context).append('<div class="rtecenter"><iframe class="video-plan" allowfullscreen="" frameborder="0" height="480" src="http://' + myvideo + '" width="640"></iframe></div>'); $('.video-plan', context).addClass('z-processed'); } }
var checkHide = (window.location.href);
if (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans')) { $('#top_bg').show(); //alert ('IF What is checkHide '+ checkHide); }else{ $('#top_bg').hide(); //alert ('ELSE What is checkHide '+ checkHide); }
// *** set up for page on load ***
$('#book-navigation-3').hide(); //planStatus.survey = 'load';
var hrefz = window.location.href.slice(window.location.href); var split1 = hrefz.split('/'); var split2 = split1[4]; // alert ('Is media by url split 2 - ' + split2); var split3 = split2.charAt(split2.length -1); // alert ('Is media by url split 3 - ' + split3);
var setupaction = $.cookie('tbp-menu'); //alert ('whats the cookie - ' + setupaction) if (setupaction == 'loadDoc'){ //do nothing just reset the cookie // alert ('does this run and reset the cookie?'); $.cookie('tbp-menu', ''); $('#top_bg').hide(); /* }else if (setupaction == 'loadSurvey'){ docUrl = $.cookie('tbp-document'); alert ('Cookie docUrl loaded - ' + docUrl); window.open(docUrl, '_parent'); manageBlocks('survey'); */
}else if (split3 == 'a'){ //} || (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == //'http://peacepharm.org/plans%27)))%7B // otherwise set up the media page and the survey // alert ('does this run and set manage blocks?');
manageBlocks('media');
}
//end wrapper } } }(jQuery)); // Note the wrapper is different for Drupal Behaviors // --------------------------- End set up ---------------------------------------------------------------------------- -----------//
function manageBlocks(menu) {( function($) { $(document).ready(function() { // jQuery wrapper
hideBlocks(); var checkHide = (window.location.href); if(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans') { $('#top_bg').hide(); /* Supports one of the following menu items as var menu * media, author, document, survey, help * *Check see we are on a plan page and save the key as a cookie *grab the bit of the url that comes after /plans/ * var href = location.href; // get the url */ // Hides to run when ** any button ** is pressed
$('.region-user2').hide(); $('.region-user3').hide(); $('#plan-extra-bar').hide(); //$('#top_bg').hide(); $('.lock-icon').hide(); $('#book-navigation-3').hide(); // use to hide nav when JS is implimented $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); }
var href = window.location.href.slice(window.location.href); var split = href.split('/plans/'); // split the string; var afterSplit = 'Not a plan'; if(split[1] != null) { afterSplit = split[1]; var urlCode = $.trim(afterSplit); //urlCode = urlTemp.split('#'); //alert('After the url split: ' + urlCode); }
if(afterSplit != 'Not a plan') { $('#top_bg').hide(); }
// If everything went well shows split[1], if not then de default error message is shown
//clean white space
//get the code off the form clean displayCode = $.trim($('.field-name-field-code .field-items .field-item').text()); //alert('Code on the page: ' + displayCode);
// setup the survey var userId = $.trim($('#this-user').text()); var userRealname = $.trim($('#this-user-name').text());
// setup for survey iframe to call back with correct vars (tokens don't work they need to be processed by PHP not JS ) var surveyPrep = ('<iframe class="autoHeight" allowfullscreen="" frameborder="0" height="900px" width="995" id="i-survey" scrolling="off"' + 'src="http://peacepharm.org/limesurvey/index.php?sid=11647' + '&lang=en' + '&11647X14X225=Generated for User No. - ' + userId + ' Real Name - ' + userRealname + ' for evaluation of plan code ' + displayCode + '.' + '&11647X14X2161=' + userId + '&11647X14X2162=' + displayCode + '"' + 'style="margin:0% auto 0% auto;">If you see this your browser does not support iframes</iframe>');
$('#poke-survey').append(surveyPrep);
if($.cookie('tbp-survey') == 'load') { alert('Defined Reload Page -- My ID= ' + userId + ' userRealname= ' + userRealname); //|| planStatus.survey == 'on' $('.region-user3').show(); $.cookie('tbp-survey', ''); planStatus.survey = 'on'; }
//alert(menu);
// media & author information swap if(menu == 'media') { $.cookie('tbp-menu', 'media'); if(urlCode == displayCode) { showDocs(); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); } else { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]); window.open(splitx[0], "_parent"); //showDocs(); //happens when a plan page is loaded in all cases } }
if(menu == 'author') { $.cookie('tbp-menu', 'media'); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); if(urlCode == displayCode) { showProfile(); } else if(urlCode != displayCode) { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]);
window.open(splitx[0], "_parent"); } else { alert('An unknown error has occurred. Error 202'); } }
// co-ment document menu on off if(menu == 'document') { docUrl = ('../plans/' + displayCode + coment); $.cookie('tbp-menu', 'loadDoc'); $.cookie('tbp-document', docUrl); //alert('plan status set as: ' + planStatus.url); //alert('docUrl the plan call url: ' + docUrl); //what is called var loadUrl = $.cookie('tbp-document'); $.cookie('protect', '');
//alert('Warning systen update in process documents are not availiable for 8 hours'); //loadUrl from cookie -- ' + docUrl);
window.open(docUrl, "_parent"); //alert('plan status set as: ' + planStatus.url);
}
// survey menu on settings protect = $.cookie('protect'); if(menu == 'off-survey') { $.cookie('tbp-menu', 'survey'); //alert('Plan status.survey == ' + planStatus.survey); if(planStatus.survey == 'on') { $('.region-user3').hide(); planStatus.survey = 'off'; }
else if(planStatus.survey == 'off') { $('.region-user3').show(); planStatus.survey = 'on'; }
/* else if (!(protect == 'survey')){ if(planStatus.survey == 'load') { if(urlCode == displayCode) { $('.region-user3').hide(); $('#poke-survey').append(surveyPrep); planStatus.survey = 'off'; $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); alert('Load from media page - ' + planStatus.survey); }
else if (!(urlCode == displayCode )) { var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; if(splitx[1] != undefined) { // set reload cookie $.cookie('tbp-menu', 'loadSurvey'); var tbpPath = (splitx[0]); $.cookie('tbp-document', tbpPath); alert ('tbp-document url cookie - ' + $.cookie('tbp-document')); alert('Load from doc page - ' + planStatus.survey); $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); window.location.reload() } }
}
}*/ }
// help menu on off if(menu == 'help') { $.cookie('tbp-document', 'media');
if (planStatus.help == 'on' ){ $('.region-user2').hide(); switchval = 'off'; //alert('Turn off: ' + planStatus.help); } if(planStatus.help == 'off' || !planStatus.help) { $('.region-user3').hide(); $('.region-user2').show(); switchval = 'on'; } //run switches planStatus.help = switchval; switch1 = switchval; planStatus.survey = switchval; //alert('Turn on: ' + planStatus.help);
}
//end wrapper }); }(jQuery)); }
//--------------------------------- Following are functions for plan page ---------------------------------------------//
function hideBlocks() {( function($) { $(document).ready(function() { // jQuery wrapper //$('.region-user3').hide(); //$('.region-user2').hide(); $('#plan-extra-bar').hide(); $('.lock-icon').hide(); //end wrapper }); }(jQuery)); }
function showDocs() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').show(); $('.field-name-body').show(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); $('#comments').show(); $('#plan-img').css('visibility', 'hidden'); $('#author-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
function showProfile() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').hide(); $('.field-name-body').hide(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').show(); $('.field-name-field-profile').show(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').show(); $('.field-name-field-facebook-group').show(); $('.field-name-field-facebook-page').show(); $('.field-name-field-author-skype').show(); $('#comments').hide(); $('#author-img').css('visibility', 'hidden'); $('#plan-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
Are you also pushing to drupal 7 or drupal 6. I noticed that your drupal behaviors model is using the drupal 6 mechanism. Is it possible that you are also porting to drupal 7?
You also have some document.ready overrides that should be coded as drupal behaviors.
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Yani Sent: Thursday, February 28, 2013 11:13 PM To: support@drupal.org Subject: [support] Jquery breaks old code...
Hi,
I've had to up the version of Jquery I'm using to support a few newer modules. In the process this has broken code I'd written that has worked for a year. Assuming I haven't added a syntax error in looking at it... and it being really basic code... I wonder if someone has hit this in the past and has any clues...
Here is the code...
Yani
/** * Theme behaviours for zeropoint * Author: Yani */
//Global Vars var displayCode; var urlCode; var coment = '-doc'; var docUrl; var mediaUrl; var planStatus = new Object; planStatus.help == 'off'; var protect; //defined as object to be used a associative array for menu status var switch1;
(function($) { Drupal.behaviors.zeroPoint = { attach : function(context, settings) { //Drupal Jquery wrapper
alert('Got to scripts.js X3');
// Plan menu version 2 // run the default
$("'#item-20t':not(.z-processed)", context); //view plan & media { $('#item-20t', context).click(function() { manageBlocks('media'); }); $('#item-20t', context).addClass('z-processed'); }
$("'#item-40t':not(.z-processed)", context); //view author { $('#item-40t', context).click(function() { manageBlocks('author'); }); $('#item-40t', context).addClass('z-processed'); }
$("'#item-30t':not(.z-processed)", context); //view document in co-ment { $('#item-30t', context).click(function() { manageBlocks('document'); }); $('#item-30t', context).addClass('z-processed'); }
$("'#item-50t'':not(.z-processed)", context); //view survey { $('#item-50t', context).click(function() { manageBlocks('survey'); }); $('#item-50t', context).addClass('z-processed'); }
$("'#item-60t':not(.z-processed)", context); //view help { $('#item-60t', context).click(function() { $('.region-user2', context).css('margin-top', '200px'); $('.region-user2', context).css('margin-left', '-1025px'); manageBlocks('help'); }); $('#item-60t', context).addClass('z-processed'); }
// close button
$("'.x-close':not(.z-processed)", context); { $('.x-close', context).click(function() { if(switch1 == 'on') { $('.region-user2').hide(); planStatus.help = 'off'; switch1 = 'off'; alert('Turn off: ' + switch1); } else { $('.region-user2').hide(); switch1 = 'off'; planStatus.help = 'off'; alert('An error has occurred in selecting the help'); } }); $('.x-close', context).addClass('z-processed'); }
// menu actions for the plan list page
$("'#item-1t':not(.z-processed)", context); { $('#item-1b', context).hide(); $('#item-1t', context).hover(function() { $('#item-1b').show(); }, function() { $('#item-1b').hide(); }); $('#item-1t', context).addClass('z-processed'); }
$("'#item-3t':not(.z-processed)", context); { $('#item-3b', context).hide(); $('#item-3t', context).hover(function() { $('#item-3b').show(); }, function() { $('#item-3b').hide(); }); $('#item-3t', context).addClass('z-processed'); }
$("'#item-4b':not(.z-processed)", context); { $('#item-4b', context).hide(); $('#item-4t', context).hover(function() { $('#item-4b').show(); }, function() { $('#item-4b').hide(); }); $('#item-4b', context).addClass('z-processed'); }
$("'#item-5t':not(.z-processed)", context); //view help { $('.region-user2', context).hide(); $('.region-user2', context).css('margin-top', '+250px'); $('.region-user2', context).css('margin-left', '-5px');
//add a class to enable positioning in css
$('#item-5t', context).click(function() { if(switch1 == 'off' || !switch1) { $('.region-user2').show(); switch1 = 'on'; //alert('Turn on: ' + switch1); } else if(switch1 == 'on') { $('.region-user2').hide(); switch1 = 'off'; //alert('Turn off: ' + switch1); } else { alert('An error has occurred in selecting the help. Error 201'); }
});
$('#item-5t', context).addClass('z-processed'); }
// clean up for header image $("'#headimg':not(.z-processed)", context); { $('#headimg', context).hide(); $('#header', context).hide(); //menu, logo etc need for loading order $('#header', context).delay(200).show(); $('#headimg', context).fadeIn(1000); $('#headimg', context).addClass('z-processed'); }
// creation of video iframe $("'.video-plan':not(.z-processed)", context); { var myvideo = $('.field-name-field-video-url .field-item').html(); if(myvideo != null && $('.video-plan').length == 0) { //alert ('myvideo Var : ' + myvideo); $('.field-name-body', context).append('<div class="rtecenter"><iframe class="video-plan" allowfullscreen="" frameborder="0" height="480" src="http://' + myvideo + '" width="640"></iframe></div>'); $('.video-plan', context).addClass('z-processed'); } }
var checkHide = (window.location.href);
if (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans')) { $('#top_bg').show(); //alert ('IF What is checkHide '+ checkHide); }else{ $('#top_bg').hide(); //alert ('ELSE What is checkHide '+ checkHide); }
// *** set up for page on load ***
$('#book-navigation-3').hide(); //planStatus.survey = 'load';
var hrefz = window.location.href.slice(window.location.href); var split1 = hrefz.split('/'); var split2 = split1[4]; // alert ('Is media by url split 2 - ' + split2); var split3 = split2.charAt(split2.length -1); // alert ('Is media by url split 3 - ' + split3);
var setupaction = $.cookie('tbp-menu'); //alert ('whats the cookie - ' + setupaction) if (setupaction == 'loadDoc'){ //do nothing just reset the cookie // alert ('does this run and reset the cookie?'); $.cookie('tbp-menu', ''); $('#top_bg').hide(); /* }else if (setupaction == 'loadSurvey'){ docUrl = $.cookie('tbp-document'); alert ('Cookie docUrl loaded - ' + docUrl); window.open(docUrl, '_parent'); manageBlocks('survey'); */
}else if (split3 == 'a'){ //} || (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == //'http://peacepharm.org/plans%27)))%7B // otherwise set up the media page and the survey // alert ('does this run and set manage blocks?');
manageBlocks('media');
}
//end wrapper } } }(jQuery)); // Note the wrapper is different for Drupal Behaviors // --------------------------- End set up ---------------------------------------------------------------------------- -----------//
function manageBlocks(menu) {( function($) { $(document).ready(function() { // jQuery wrapper
hideBlocks(); var checkHide = (window.location.href); if(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans') { $('#top_bg').hide(); /* Supports one of the following menu items as var menu * media, author, document, survey, help * *Check see we are on a plan page and save the key as a cookie *grab the bit of the url that comes after /plans/ * var href = location.href; // get the url */ // Hides to run when ** any button ** is pressed
$('.region-user2').hide(); $('.region-user3').hide(); $('#plan-extra-bar').hide(); //$('#top_bg').hide(); $('.lock-icon').hide(); $('#book-navigation-3').hide(); // use to hide nav when JS is implimented $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); }
var href = window.location.href.slice(window.location.href); var split = href.split('/plans/'); // split the string; var afterSplit = 'Not a plan'; if(split[1] != null) { afterSplit = split[1]; var urlCode = $.trim(afterSplit); //urlCode = urlTemp.split('#'); //alert('After the url split: ' + urlCode); }
if(afterSplit != 'Not a plan') { $('#top_bg').hide(); }
// If everything went well shows split[1], if not then de default error message is shown
//clean white space
//get the code off the form clean displayCode = $.trim($('.field-name-field-code .field-items .field-item').text()); //alert('Code on the page: ' + displayCode);
// setup the survey var userId = $.trim($('#this-user').text()); var userRealname = $.trim($('#this-user-name').text());
// setup for survey iframe to call back with correct vars (tokens don't work they need to be processed by PHP not JS ) var surveyPrep = ('<iframe class="autoHeight" allowfullscreen="" frameborder="0" height="900px" width="995" id="i-survey" scrolling="off"' + 'src="http://peacepharm.org/limesurvey/index.php?sid=11647' + '&lang=en' + '&11647X14X225=Generated for User No. - ' + userId + ' Real Name - ' + userRealname + ' for evaluation of plan code ' + displayCode + '.' + '&11647X14X2161=' + userId + '&11647X14X2162=' + displayCode + '"' + 'style="margin:0% auto 0% auto;">If you see this your browser does not support iframes</iframe>');
$('#poke-survey').append(surveyPrep);
if($.cookie('tbp-survey') == 'load') { alert('Defined Reload Page -- My ID= ' + userId + ' userRealname= ' + userRealname); //|| planStatus.survey == 'on' $('.region-user3').show(); $.cookie('tbp-survey', ''); planStatus.survey = 'on'; }
//alert(menu);
// media & author information swap if(menu == 'media') { $.cookie('tbp-menu', 'media'); if(urlCode == displayCode) { showDocs(); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); } else { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]); window.open(splitx[0], "_parent"); //showDocs(); //happens when a plan page is loaded in all cases } }
if(menu == 'author') { $.cookie('tbp-menu', 'media'); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); if(urlCode == displayCode) { showProfile(); } else if(urlCode != displayCode) { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]);
window.open(splitx[0], "_parent"); } else { alert('An unknown error has occurred. Error 202'); } }
// co-ment document menu on off if(menu == 'document') { docUrl = ('../plans/' + displayCode + coment); $.cookie('tbp-menu', 'loadDoc'); $.cookie('tbp-document', docUrl); //alert('plan status set as: ' + planStatus.url); //alert('docUrl the plan call url: ' + docUrl); //what is called var loadUrl = $.cookie('tbp-document'); $.cookie('protect', '');
//alert('Warning systen update in process documents are not availiable for 8 hours'); //loadUrl from cookie -- ' + docUrl);
window.open(docUrl, "_parent"); //alert('plan status set as: ' + planStatus.url);
}
// survey menu on settings protect = $.cookie('protect'); if(menu == 'off-survey') { $.cookie('tbp-menu', 'survey'); //alert('Plan status.survey == ' + planStatus.survey); if(planStatus.survey == 'on') { $('.region-user3').hide(); planStatus.survey = 'off'; }
else if(planStatus.survey == 'off') { $('.region-user3').show(); planStatus.survey = 'on'; }
/* else if (!(protect == 'survey')){ if(planStatus.survey == 'load') { if(urlCode == displayCode) { $('.region-user3').hide(); $('#poke-survey').append(surveyPrep); planStatus.survey = 'off'; $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); alert('Load from media page - ' + planStatus.survey); }
else if (!(urlCode == displayCode )) { var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; if(splitx[1] != undefined) { // set reload cookie $.cookie('tbp-menu', 'loadSurvey'); var tbpPath = (splitx[0]); $.cookie('tbp-document', tbpPath); alert ('tbp-document url cookie - ' + $.cookie('tbp-document')); alert('Load from doc page - ' + planStatus.survey); $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); window.location.reload() } }
}
}*/ }
// help menu on off if(menu == 'help') { $.cookie('tbp-document', 'media');
if (planStatus.help == 'on' ){ $('.region-user2').hide(); switchval = 'off'; //alert('Turn off: ' + planStatus.help); } if(planStatus.help == 'off' || !planStatus.help) { $('.region-user3').hide(); $('.region-user2').show(); switchval = 'on'; } //run switches planStatus.help = switchval; switch1 = switchval; planStatus.survey = switchval; //alert('Turn on: ' + planStatus.help);
}
//end wrapper }); }(jQuery)); }
//--------------------------------- Following are functions for plan page ---------------------------------------------//
function hideBlocks() {( function($) { $(document).ready(function() { // jQuery wrapper //$('.region-user3').hide(); //$('.region-user2').hide(); $('#plan-extra-bar').hide(); $('.lock-icon').hide(); //end wrapper }); }(jQuery)); }
function showDocs() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').show(); $('.field-name-body').show(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); $('#comments').show(); $('#plan-img').css('visibility', 'hidden'); $('#author-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
function showProfile() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').hide(); $('.field-name-body').hide(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').show(); $('.field-name-field-profile').show(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').show(); $('.field-name-field-facebook-group').show(); $('.field-name-field-facebook-page').show(); $('.field-name-field-author-skype').show(); $('#comments').hide(); $('#author-img').css('visibility', 'hidden'); $('#plan-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
Drupal 7.
Amazing it worked perfectly until the update of jQuery.
It would have been done shortly after the release of Drupal 7 guided by whatever tutorials I had at the time.
Yani
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Metzler, David Sent: Saturday, 02 March 2013 2:15 AM To: 'support@drupal.org' Subject: Re: [support] Jquery breaks old code...
Are you also pushing to drupal 7 or drupal 6. I noticed that your drupal behaviors model is using the drupal 6 mechanism. Is it possible that you are also porting to drupal 7?
You also have some document.ready overrides that should be coded as drupal behaviors.
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Yani Sent: Thursday, February 28, 2013 11:13 PM To: support@drupal.org Subject: [support] Jquery breaks old code...
Hi,
I've had to up the version of Jquery I'm using to support a few newer modules. In the process this has broken code I'd written that has worked for a year. Assuming I haven't added a syntax error in looking at it... and it being really basic code... I wonder if someone has hit this in the past and has any clues...
Here is the code...
Yani
/** * Theme behaviours for zeropoint * Author: Yani */
//Global Vars var displayCode; var urlCode; var coment = '-doc'; var docUrl; var mediaUrl; var planStatus = new Object; planStatus.help == 'off'; var protect; //defined as object to be used a associative array for menu status var switch1;
(function($) { Drupal.behaviors.zeroPoint = { attach : function(context, settings) { //Drupal Jquery wrapper
alert('Got to scripts.js X3');
// Plan menu version 2 // run the default
$("'#item-20t':not(.z-processed)", context); //view plan & media { $('#item-20t', context).click(function() { manageBlocks('media'); }); $('#item-20t', context).addClass('z-processed'); }
$("'#item-40t':not(.z-processed)", context); //view author { $('#item-40t', context).click(function() { manageBlocks('author'); }); $('#item-40t', context).addClass('z-processed'); }
$("'#item-30t':not(.z-processed)", context); //view document in co-ment { $('#item-30t', context).click(function() { manageBlocks('document'); }); $('#item-30t', context).addClass('z-processed'); }
$("'#item-50t'':not(.z-processed)", context); //view survey { $('#item-50t', context).click(function() { manageBlocks('survey'); }); $('#item-50t', context).addClass('z-processed'); }
$("'#item-60t':not(.z-processed)", context); //view help { $('#item-60t', context).click(function() { $('.region-user2', context).css('margin-top', '200px'); $('.region-user2', context).css('margin-left', '-1025px'); manageBlocks('help'); }); $('#item-60t', context).addClass('z-processed'); }
// close button
$("'.x-close':not(.z-processed)", context); { $('.x-close', context).click(function() { if(switch1 == 'on') { $('.region-user2').hide(); planStatus.help = 'off'; switch1 = 'off'; alert('Turn off: ' + switch1); } else { $('.region-user2').hide(); switch1 = 'off'; planStatus.help = 'off'; alert('An error has occurred in selecting the help'); } }); $('.x-close', context).addClass('z-processed'); }
// menu actions for the plan list page
$("'#item-1t':not(.z-processed)", context); { $('#item-1b', context).hide(); $('#item-1t', context).hover(function() { $('#item-1b').show(); }, function() { $('#item-1b').hide(); }); $('#item-1t', context).addClass('z-processed'); }
$("'#item-3t':not(.z-processed)", context); { $('#item-3b', context).hide(); $('#item-3t', context).hover(function() { $('#item-3b').show(); }, function() { $('#item-3b').hide(); }); $('#item-3t', context).addClass('z-processed'); }
$("'#item-4b':not(.z-processed)", context); { $('#item-4b', context).hide(); $('#item-4t', context).hover(function() { $('#item-4b').show(); }, function() { $('#item-4b').hide(); }); $('#item-4b', context).addClass('z-processed'); }
$("'#item-5t':not(.z-processed)", context); //view help { $('.region-user2', context).hide(); $('.region-user2', context).css('margin-top', '+250px'); $('.region-user2', context).css('margin-left', '-5px');
//add a class to enable positioning in css
$('#item-5t', context).click(function() { if(switch1 == 'off' || !switch1) { $('.region-user2').show(); switch1 = 'on'; //alert('Turn on: ' + switch1); } else if(switch1 == 'on') { $('.region-user2').hide(); switch1 = 'off'; //alert('Turn off: ' + switch1); } else { alert('An error has occurred in selecting the help. Error 201'); }
});
$('#item-5t', context).addClass('z-processed'); }
// clean up for header image $("'#headimg':not(.z-processed)", context); { $('#headimg', context).hide(); $('#header', context).hide(); //menu, logo etc need for loading order $('#header', context).delay(200).show(); $('#headimg', context).fadeIn(1000); $('#headimg', context).addClass('z-processed'); }
// creation of video iframe $("'.video-plan':not(.z-processed)", context); { var myvideo = $('.field-name-field-video-url .field-item').html(); if(myvideo != null && $('.video-plan').length == 0) { //alert ('myvideo Var : ' + myvideo); $('.field-name-body', context).append('<div class="rtecenter"><iframe class="video-plan" allowfullscreen="" frameborder="0" height="480" src="http://' + myvideo + '" width="640"></iframe></div>'); $('.video-plan', context).addClass('z-processed'); } }
var checkHide = (window.location.href);
if (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans')) { $('#top_bg').show(); //alert ('IF What is checkHide '+ checkHide); }else{ $('#top_bg').hide(); //alert ('ELSE What is checkHide '+ checkHide); }
// *** set up for page on load ***
$('#book-navigation-3').hide(); //planStatus.survey = 'load';
var hrefz = window.location.href.slice(window.location.href); var split1 = hrefz.split('/'); var split2 = split1[4]; // alert ('Is media by url split 2 - ' + split2); var split3 = split2.charAt(split2.length -1); // alert ('Is media by url split 3 - ' + split3);
var setupaction = $.cookie('tbp-menu'); //alert ('whats the cookie - ' + setupaction) if (setupaction == 'loadDoc'){ //do nothing just reset the cookie // alert ('does this run and reset the cookie?'); $.cookie('tbp-menu', ''); $('#top_bg').hide(); /* }else if (setupaction == 'loadSurvey'){ docUrl = $.cookie('tbp-document'); alert ('Cookie docUrl loaded - ' + docUrl); window.open(docUrl, '_parent'); manageBlocks('survey'); */
}else if (split3 == 'a'){ //} || (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == //'http://peacepharm.org/plans%27)))%7B // otherwise set up the media page and the survey // alert ('does this run and set manage blocks?');
manageBlocks('media');
}
//end wrapper } } }(jQuery)); // Note the wrapper is different for Drupal Behaviors // --------------------------- End set up ---------------------------------------------------------------------------- -----------//
function manageBlocks(menu) {( function($) { $(document).ready(function() { // jQuery wrapper
hideBlocks(); var checkHide = (window.location.href); if(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans') { $('#top_bg').hide(); /* Supports one of the following menu items as var menu * media, author, document, survey, help * *Check see we are on a plan page and save the key as a cookie *grab the bit of the url that comes after /plans/ * var href = location.href; // get the url */ // Hides to run when ** any button ** is pressed
$('.region-user2').hide(); $('.region-user3').hide(); $('#plan-extra-bar').hide(); //$('#top_bg').hide(); $('.lock-icon').hide(); $('#book-navigation-3').hide(); // use to hide nav when JS is implimented $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); }
var href = window.location.href.slice(window.location.href); var split = href.split('/plans/'); // split the string; var afterSplit = 'Not a plan'; if(split[1] != null) { afterSplit = split[1]; var urlCode = $.trim(afterSplit); //urlCode = urlTemp.split('#'); //alert('After the url split: ' + urlCode); }
if(afterSplit != 'Not a plan') { $('#top_bg').hide(); }
// If everything went well shows split[1], if not then de default error message is shown
//clean white space
//get the code off the form clean displayCode = $.trim($('.field-name-field-code .field-items .field-item').text()); //alert('Code on the page: ' + displayCode);
// setup the survey var userId = $.trim($('#this-user').text()); var userRealname = $.trim($('#this-user-name').text());
// setup for survey iframe to call back with correct vars (tokens don't work they need to be processed by PHP not JS ) var surveyPrep = ('<iframe class="autoHeight" allowfullscreen="" frameborder="0" height="900px" width="995" id="i-survey" scrolling="off"' + 'src="http://peacepharm.org/limesurvey/index.php?sid=11647' + '&lang=en' + '&11647X14X225=Generated for User No. - ' + userId + ' Real Name - ' + userRealname + ' for evaluation of plan code ' + displayCode + '.' + '&11647X14X2161=' + userId + '&11647X14X2162=' + displayCode + '"' + 'style="margin:0% auto 0% auto;">If you see this your browser does not support iframes</iframe>');
$('#poke-survey').append(surveyPrep);
if($.cookie('tbp-survey') == 'load') { alert('Defined Reload Page -- My ID= ' + userId + ' userRealname= ' + userRealname); //|| planStatus.survey == 'on' $('.region-user3').show(); $.cookie('tbp-survey', ''); planStatus.survey = 'on'; }
//alert(menu);
// media & author information swap if(menu == 'media') { $.cookie('tbp-menu', 'media'); if(urlCode == displayCode) { showDocs(); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); } else { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]); window.open(splitx[0], "_parent"); //showDocs(); //happens when a plan page is loaded in all cases } }
if(menu == 'author') { $.cookie('tbp-menu', 'media'); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); if(urlCode == displayCode) { showProfile(); } else if(urlCode != displayCode) { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]);
window.open(splitx[0], "_parent"); } else { alert('An unknown error has occurred. Error 202'); } }
// co-ment document menu on off if(menu == 'document') { docUrl = ('../plans/' + displayCode + coment); $.cookie('tbp-menu', 'loadDoc'); $.cookie('tbp-document', docUrl); //alert('plan status set as: ' + planStatus.url); //alert('docUrl the plan call url: ' + docUrl); //what is called var loadUrl = $.cookie('tbp-document'); $.cookie('protect', '');
//alert('Warning systen update in process documents are not availiable for 8 hours'); //loadUrl from cookie -- ' + docUrl);
window.open(docUrl, "_parent"); //alert('plan status set as: ' + planStatus.url);
}
// survey menu on settings protect = $.cookie('protect'); if(menu == 'off-survey') { $.cookie('tbp-menu', 'survey'); //alert('Plan status.survey == ' + planStatus.survey); if(planStatus.survey == 'on') { $('.region-user3').hide(); planStatus.survey = 'off'; }
else if(planStatus.survey == 'off') { $('.region-user3').show(); planStatus.survey = 'on'; }
/* else if (!(protect == 'survey')){ if(planStatus.survey == 'load') { if(urlCode == displayCode) { $('.region-user3').hide(); $('#poke-survey').append(surveyPrep); planStatus.survey = 'off'; $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); alert('Load from media page - ' + planStatus.survey); }
else if (!(urlCode == displayCode )) { var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; if(splitx[1] != undefined) { // set reload cookie $.cookie('tbp-menu', 'loadSurvey'); var tbpPath = (splitx[0]); $.cookie('tbp-document', tbpPath); alert ('tbp-document url cookie - ' + $.cookie('tbp-document')); alert('Load from doc page - ' + planStatus.survey); $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); window.location.reload() } }
}
}*/ }
// help menu on off if(menu == 'help') { $.cookie('tbp-document', 'media');
if (planStatus.help == 'on' ){ $('.region-user2').hide(); switchval = 'off'; //alert('Turn off: ' + planStatus.help); } if(planStatus.help == 'off' || !planStatus.help) { $('.region-user3').hide(); $('.region-user2').show(); switchval = 'on'; } //run switches planStatus.help = switchval; switch1 = switchval; planStatus.survey = switchval; //alert('Turn on: ' + planStatus.help);
}
//end wrapper }); }(jQuery)); }
//--------------------------------- Following are functions for plan page ---------------------------------------------//
function hideBlocks() {( function($) { $(document).ready(function() { // jQuery wrapper //$('.region-user3').hide(); //$('.region-user2').hide(); $('#plan-extra-bar').hide(); $('.lock-icon').hide(); //end wrapper }); }(jQuery)); }
function showDocs() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').show(); $('.field-name-body').show(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); $('#comments').show(); $('#plan-img').css('visibility', 'hidden'); $('#author-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
function showProfile() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').hide(); $('.field-name-body').hide(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').show(); $('.field-name-field-profile').show(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').show(); $('.field-name-field-facebook-group').show(); $('.field-name-field-facebook-page').show(); $('.field-name-field-author-skype').show(); $('#comments').hide(); $('#author-img').css('visibility', 'hidden'); $('#plan-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
I can see this error...
}(jQuery)); >> should be >> })(jQuery);
Wonder it ever worked. But that hasn't resolved it.
Yani
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Yani Sent: Saturday, 02 March 2013 3:41 AM To: support@drupal.org Subject: Re: [support] Jquery breaks old code...
Drupal 7.
Amazing it worked perfectly until the update of jQuery.
It would have been done shortly after the release of Drupal 7 guided by whatever tutorials I had at the time.
Yani
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Metzler, David Sent: Saturday, 02 March 2013 2:15 AM To: 'support@drupal.org' Subject: Re: [support] Jquery breaks old code...
Are you also pushing to drupal 7 or drupal 6. I noticed that your drupal behaviors model is using the drupal 6 mechanism. Is it possible that you are also porting to drupal 7?
You also have some document.ready overrides that should be coded as drupal behaviors.
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Yani Sent: Thursday, February 28, 2013 11:13 PM To: support@drupal.org Subject: [support] Jquery breaks old code...
Hi,
I've had to up the version of Jquery I'm using to support a few newer modules. In the process this has broken code I'd written that has worked for a year. Assuming I haven't added a syntax error in looking at it... and it being really basic code... I wonder if someone has hit this in the past and has any clues...
Here is the code...
Yani
/** * Theme behaviours for zeropoint * Author: Yani */
//Global Vars var displayCode; var urlCode; var coment = '-doc'; var docUrl; var mediaUrl; var planStatus = new Object; planStatus.help == 'off'; var protect; //defined as object to be used a associative array for menu status var switch1;
(function($) { Drupal.behaviors.zeroPoint = { attach : function(context, settings) { //Drupal Jquery wrapper
alert('Got to scripts.js X3');
// Plan menu version 2 // run the default
$("'#item-20t':not(.z-processed)", context); //view plan & media { $('#item-20t', context).click(function() { manageBlocks('media'); }); $('#item-20t', context).addClass('z-processed'); }
$("'#item-40t':not(.z-processed)", context); //view author { $('#item-40t', context).click(function() { manageBlocks('author'); }); $('#item-40t', context).addClass('z-processed'); }
$("'#item-30t':not(.z-processed)", context); //view document in co-ment { $('#item-30t', context).click(function() { manageBlocks('document'); }); $('#item-30t', context).addClass('z-processed'); }
$("'#item-50t'':not(.z-processed)", context); //view survey { $('#item-50t', context).click(function() { manageBlocks('survey'); }); $('#item-50t', context).addClass('z-processed'); }
$("'#item-60t':not(.z-processed)", context); //view help { $('#item-60t', context).click(function() { $('.region-user2', context).css('margin-top', '200px'); $('.region-user2', context).css('margin-left', '-1025px'); manageBlocks('help'); }); $('#item-60t', context).addClass('z-processed'); }
// close button
$("'.x-close':not(.z-processed)", context); { $('.x-close', context).click(function() { if(switch1 == 'on') { $('.region-user2').hide(); planStatus.help = 'off'; switch1 = 'off'; alert('Turn off: ' + switch1); } else { $('.region-user2').hide(); switch1 = 'off'; planStatus.help = 'off'; alert('An error has occurred in selecting the help'); } }); $('.x-close', context).addClass('z-processed'); }
// menu actions for the plan list page
$("'#item-1t':not(.z-processed)", context); { $('#item-1b', context).hide(); $('#item-1t', context).hover(function() { $('#item-1b').show(); }, function() { $('#item-1b').hide(); }); $('#item-1t', context).addClass('z-processed'); }
$("'#item-3t':not(.z-processed)", context); { $('#item-3b', context).hide(); $('#item-3t', context).hover(function() { $('#item-3b').show(); }, function() { $('#item-3b').hide(); }); $('#item-3t', context).addClass('z-processed'); }
$("'#item-4b':not(.z-processed)", context); { $('#item-4b', context).hide(); $('#item-4t', context).hover(function() { $('#item-4b').show(); }, function() { $('#item-4b').hide(); }); $('#item-4b', context).addClass('z-processed'); }
$("'#item-5t':not(.z-processed)", context); //view help { $('.region-user2', context).hide(); $('.region-user2', context).css('margin-top', '+250px'); $('.region-user2', context).css('margin-left', '-5px');
//add a class to enable positioning in css
$('#item-5t', context).click(function() { if(switch1 == 'off' || !switch1) { $('.region-user2').show(); switch1 = 'on'; //alert('Turn on: ' + switch1); } else if(switch1 == 'on') { $('.region-user2').hide(); switch1 = 'off'; //alert('Turn off: ' + switch1); } else { alert('An error has occurred in selecting the help. Error 201'); }
});
$('#item-5t', context).addClass('z-processed'); }
// clean up for header image $("'#headimg':not(.z-processed)", context); { $('#headimg', context).hide(); $('#header', context).hide(); //menu, logo etc need for loading order $('#header', context).delay(200).show(); $('#headimg', context).fadeIn(1000); $('#headimg', context).addClass('z-processed'); }
// creation of video iframe $("'.video-plan':not(.z-processed)", context); { var myvideo = $('.field-name-field-video-url .field-item').html(); if(myvideo != null && $('.video-plan').length == 0) { //alert ('myvideo Var : ' + myvideo); $('.field-name-body', context).append('<div class="rtecenter"><iframe class="video-plan" allowfullscreen="" frameborder="0" height="480" src="http://' + myvideo + '" width="640"></iframe></div>'); $('.video-plan', context).addClass('z-processed'); } }
var checkHide = (window.location.href);
if (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans')) { $('#top_bg').show(); //alert ('IF What is checkHide '+ checkHide); }else{ $('#top_bg').hide(); //alert ('ELSE What is checkHide '+ checkHide); }
// *** set up for page on load ***
$('#book-navigation-3').hide(); //planStatus.survey = 'load';
var hrefz = window.location.href.slice(window.location.href); var split1 = hrefz.split('/'); var split2 = split1[4]; // alert ('Is media by url split 2 - ' + split2); var split3 = split2.charAt(split2.length -1); // alert ('Is media by url split 3 - ' + split3);
var setupaction = $.cookie('tbp-menu'); //alert ('whats the cookie - ' + setupaction) if (setupaction == 'loadDoc'){ //do nothing just reset the cookie // alert ('does this run and reset the cookie?'); $.cookie('tbp-menu', ''); $('#top_bg').hide(); /* }else if (setupaction == 'loadSurvey'){ docUrl = $.cookie('tbp-document'); alert ('Cookie docUrl loaded - ' + docUrl); window.open(docUrl, '_parent'); manageBlocks('survey'); */
}else if (split3 == 'a'){ //} || (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == //'http://peacepharm.org/plans%27)))%7B // otherwise set up the media page and the survey // alert ('does this run and set manage blocks?');
manageBlocks('media');
}
//end wrapper } } }(jQuery)); // Note the wrapper is different for Drupal Behaviors // --------------------------- End set up ---------------------------------------------------------------------------- -----------//
function manageBlocks(menu) {( function($) { $(document).ready(function() { // jQuery wrapper
hideBlocks(); var checkHide = (window.location.href); if(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans') { $('#top_bg').hide(); /* Supports one of the following menu items as var menu * media, author, document, survey, help * *Check see we are on a plan page and save the key as a cookie *grab the bit of the url that comes after /plans/ * var href = location.href; // get the url */ // Hides to run when ** any button ** is pressed
$('.region-user2').hide(); $('.region-user3').hide(); $('#plan-extra-bar').hide(); //$('#top_bg').hide(); $('.lock-icon').hide(); $('#book-navigation-3').hide(); // use to hide nav when JS is implimented $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); }
var href = window.location.href.slice(window.location.href); var split = href.split('/plans/'); // split the string; var afterSplit = 'Not a plan'; if(split[1] != null) { afterSplit = split[1]; var urlCode = $.trim(afterSplit); //urlCode = urlTemp.split('#'); //alert('After the url split: ' + urlCode); }
if(afterSplit != 'Not a plan') { $('#top_bg').hide(); }
// If everything went well shows split[1], if not then de default error message is shown
//clean white space
//get the code off the form clean displayCode = $.trim($('.field-name-field-code .field-items .field-item').text()); //alert('Code on the page: ' + displayCode);
// setup the survey var userId = $.trim($('#this-user').text()); var userRealname = $.trim($('#this-user-name').text());
// setup for survey iframe to call back with correct vars (tokens don't work they need to be processed by PHP not JS ) var surveyPrep = ('<iframe class="autoHeight" allowfullscreen="" frameborder="0" height="900px" width="995" id="i-survey" scrolling="off"' + 'src="http://peacepharm.org/limesurvey/index.php?sid=11647' + '&lang=en' + '&11647X14X225=Generated for User No. - ' + userId + ' Real Name - ' + userRealname + ' for evaluation of plan code ' + displayCode + '.' + '&11647X14X2161=' + userId + '&11647X14X2162=' + displayCode + '"' + 'style="margin:0% auto 0% auto;">If you see this your browser does not support iframes</iframe>');
$('#poke-survey').append(surveyPrep);
if($.cookie('tbp-survey') == 'load') { alert('Defined Reload Page -- My ID= ' + userId + ' userRealname= ' + userRealname); //|| planStatus.survey == 'on' $('.region-user3').show(); $.cookie('tbp-survey', ''); planStatus.survey = 'on'; }
//alert(menu);
// media & author information swap if(menu == 'media') { $.cookie('tbp-menu', 'media'); if(urlCode == displayCode) { showDocs(); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); } else { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]); window.open(splitx[0], "_parent"); //showDocs(); //happens when a plan page is loaded in all cases } }
if(menu == 'author') { $.cookie('tbp-menu', 'media'); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); if(urlCode == displayCode) { showProfile(); } else if(urlCode != displayCode) { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]);
window.open(splitx[0], "_parent"); } else { alert('An unknown error has occurred. Error 202'); } }
// co-ment document menu on off if(menu == 'document') { docUrl = ('../plans/' + displayCode + coment); $.cookie('tbp-menu', 'loadDoc'); $.cookie('tbp-document', docUrl); //alert('plan status set as: ' + planStatus.url); //alert('docUrl the plan call url: ' + docUrl); //what is called var loadUrl = $.cookie('tbp-document'); $.cookie('protect', '');
//alert('Warning systen update in process documents are not availiable for 8 hours'); //loadUrl from cookie -- ' + docUrl);
window.open(docUrl, "_parent"); //alert('plan status set as: ' + planStatus.url);
}
// survey menu on settings protect = $.cookie('protect'); if(menu == 'off-survey') { $.cookie('tbp-menu', 'survey'); //alert('Plan status.survey == ' + planStatus.survey); if(planStatus.survey == 'on') { $('.region-user3').hide(); planStatus.survey = 'off'; }
else if(planStatus.survey == 'off') { $('.region-user3').show(); planStatus.survey = 'on'; }
/* else if (!(protect == 'survey')){ if(planStatus.survey == 'load') { if(urlCode == displayCode) { $('.region-user3').hide(); $('#poke-survey').append(surveyPrep); planStatus.survey = 'off'; $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); alert('Load from media page - ' + planStatus.survey); }
else if (!(urlCode == displayCode )) { var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; if(splitx[1] != undefined) { // set reload cookie $.cookie('tbp-menu', 'loadSurvey'); var tbpPath = (splitx[0]); $.cookie('tbp-document', tbpPath); alert ('tbp-document url cookie - ' + $.cookie('tbp-document')); alert('Load from doc page - ' + planStatus.survey); $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); window.location.reload() } }
}
}*/ }
// help menu on off if(menu == 'help') { $.cookie('tbp-document', 'media');
if (planStatus.help == 'on' ){ $('.region-user2').hide(); switchval = 'off'; //alert('Turn off: ' + planStatus.help); } if(planStatus.help == 'off' || !planStatus.help) { $('.region-user3').hide(); $('.region-user2').show(); switchval = 'on'; } //run switches planStatus.help = switchval; switch1 = switchval; planStatus.survey = switchval; //alert('Turn on: ' + planStatus.help);
}
//end wrapper }); }(jQuery)); }
//--------------------------------- Following are functions for plan page ---------------------------------------------//
function hideBlocks() {( function($) { $(document).ready(function() { // jQuery wrapper //$('.region-user3').hide(); //$('.region-user2').hide(); $('#plan-extra-bar').hide(); $('.lock-icon').hide(); //end wrapper }); }(jQuery)); }
function showDocs() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').show(); $('.field-name-body').show(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); $('#comments').show(); $('#plan-img').css('visibility', 'hidden'); $('#author-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
function showProfile() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').hide(); $('.field-name-body').hide(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').show(); $('.field-name-field-profile').show(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').show(); $('.field-name-field-facebook-group').show(); $('.field-name-field-facebook-page').show(); $('.field-name-field-author-skype').show(); $('#comments').hide(); $('#author-img').css('visibility', 'hidden'); $('#plan-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
Sorry my bad. I see the attach methods now. I could've sworn they were missing last time. MY point about document ready overrides still stands though.
function manageBlocks(menu) {( function($) { $(document).ready(function()
That should not exist there are others. You need to make sure you're creating behaviors instead.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Yani Sent: Friday, March 01, 2013 9:41 AM To: support@drupal.org Subject: Re: [support] Jquery breaks old code...
Drupal 7.
Amazing it worked perfectly until the update of jQuery.
It would have been done shortly after the release of Drupal 7 guided by whatever tutorials I had at the time.
Yani
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Metzler, David Sent: Saturday, 02 March 2013 2:15 AM To: 'support@drupal.org' Subject: Re: [support] Jquery breaks old code...
Are you also pushing to drupal 7 or drupal 6. I noticed that your drupal behaviors model is using the drupal 6 mechanism. Is it possible that you are also porting to drupal 7?
You also have some document.ready overrides that should be coded as drupal behaviors.
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Yani Sent: Thursday, February 28, 2013 11:13 PM To: support@drupal.org Subject: [support] Jquery breaks old code...
Hi,
I've had to up the version of Jquery I'm using to support a few newer modules. In the process this has broken code I'd written that has worked for a year. Assuming I haven't added a syntax error in looking at it... and it being really basic code... I wonder if someone has hit this in the past and has any clues...
Here is the code...
Yani
/** * Theme behaviours for zeropoint * Author: Yani */
//Global Vars var displayCode; var urlCode; var coment = '-doc'; var docUrl; var mediaUrl; var planStatus = new Object; planStatus.help == 'off'; var protect; //defined as object to be used a associative array for menu status var switch1;
(function($) { Drupal.behaviors.zeroPoint = { attach : function(context, settings) { //Drupal Jquery wrapper
alert('Got to scripts.js X3');
// Plan menu version 2 // run the default
$("'#item-20t':not(.z-processed)", context); //view plan & media { $('#item-20t', context).click(function() { manageBlocks('media'); }); $('#item-20t', context).addClass('z-processed'); }
$("'#item-40t':not(.z-processed)", context); //view author { $('#item-40t', context).click(function() { manageBlocks('author'); }); $('#item-40t', context).addClass('z-processed'); }
$("'#item-30t':not(.z-processed)", context); //view document in co-ment { $('#item-30t', context).click(function() { manageBlocks('document'); }); $('#item-30t', context).addClass('z-processed'); }
$("'#item-50t'':not(.z-processed)", context); //view survey { $('#item-50t', context).click(function() { manageBlocks('survey'); }); $('#item-50t', context).addClass('z-processed'); }
$("'#item-60t':not(.z-processed)", context); //view help { $('#item-60t', context).click(function() { $('.region-user2', context).css('margin-top', '200px'); $('.region-user2', context).css('margin-left', '-1025px'); manageBlocks('help'); }); $('#item-60t', context).addClass('z-processed'); }
// close button
$("'.x-close':not(.z-processed)", context); { $('.x-close', context).click(function() { if(switch1 == 'on') { $('.region-user2').hide(); planStatus.help = 'off'; switch1 = 'off'; alert('Turn off: ' + switch1); } else { $('.region-user2').hide(); switch1 = 'off'; planStatus.help = 'off'; alert('An error has occurred in selecting the help'); } }); $('.x-close', context).addClass('z-processed'); }
// menu actions for the plan list page
$("'#item-1t':not(.z-processed)", context); { $('#item-1b', context).hide(); $('#item-1t', context).hover(function() { $('#item-1b').show(); }, function() { $('#item-1b').hide(); }); $('#item-1t', context).addClass('z-processed'); }
$("'#item-3t':not(.z-processed)", context); { $('#item-3b', context).hide(); $('#item-3t', context).hover(function() { $('#item-3b').show(); }, function() { $('#item-3b').hide(); }); $('#item-3t', context).addClass('z-processed'); }
$("'#item-4b':not(.z-processed)", context); { $('#item-4b', context).hide(); $('#item-4t', context).hover(function() { $('#item-4b').show(); }, function() { $('#item-4b').hide(); }); $('#item-4b', context).addClass('z-processed'); }
$("'#item-5t':not(.z-processed)", context); //view help { $('.region-user2', context).hide(); $('.region-user2', context).css('margin-top', '+250px'); $('.region-user2', context).css('margin-left', '-5px');
//add a class to enable positioning in css
$('#item-5t', context).click(function() { if(switch1 == 'off' || !switch1) { $('.region-user2').show(); switch1 = 'on'; //alert('Turn on: ' + switch1); } else if(switch1 == 'on') { $('.region-user2').hide(); switch1 = 'off'; //alert('Turn off: ' + switch1); } else { alert('An error has occurred in selecting the help. Error 201'); }
});
$('#item-5t', context).addClass('z-processed'); }
// clean up for header image $("'#headimg':not(.z-processed)", context); { $('#headimg', context).hide(); $('#header', context).hide(); //menu, logo etc need for loading order $('#header', context).delay(200).show(); $('#headimg', context).fadeIn(1000); $('#headimg', context).addClass('z-processed'); }
// creation of video iframe $("'.video-plan':not(.z-processed)", context); { var myvideo = $('.field-name-field-video-url .field-item').html(); if(myvideo != null && $('.video-plan').length == 0) { //alert ('myvideo Var : ' + myvideo); $('.field-name-body', context).append('<div class="rtecenter"><iframe class="video-plan" allowfullscreen="" frameborder="0" height="480" src="http://' + myvideo + '" width="640"></iframe></div>'); $('.video-plan', context).addClass('z-processed'); } }
var checkHide = (window.location.href);
if (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans')) { $('#top_bg').show(); //alert ('IF What is checkHide '+ checkHide); }else{ $('#top_bg').hide(); //alert ('ELSE What is checkHide '+ checkHide); }
// *** set up for page on load ***
$('#book-navigation-3').hide(); //planStatus.survey = 'load';
var hrefz = window.location.href.slice(window.location.href); var split1 = hrefz.split('/'); var split2 = split1[4]; // alert ('Is media by url split 2 - ' + split2); var split3 = split2.charAt(split2.length -1); // alert ('Is media by url split 3 - ' + split3);
var setupaction = $.cookie('tbp-menu'); //alert ('whats the cookie - ' + setupaction) if (setupaction == 'loadDoc'){ //do nothing just reset the cookie // alert ('does this run and reset the cookie?'); $.cookie('tbp-menu', ''); $('#top_bg').hide(); /* }else if (setupaction == 'loadSurvey'){ docUrl = $.cookie('tbp-document'); alert ('Cookie docUrl loaded - ' + docUrl); window.open(docUrl, '_parent'); manageBlocks('survey'); */
}else if (split3 == 'a'){ //} || (!(checkHide == 'http://www.peacepharm.org/plans' || checkHide == //'http://peacepharm.org/plans%27)))%7B // otherwise set up the media page and the survey // alert ('does this run and set manage blocks?');
manageBlocks('media');
}
//end wrapper } } }(jQuery)); // Note the wrapper is different for Drupal Behaviors // --------------------------- End set up ---------------------------------------------------------------------------- -----------//
function manageBlocks(menu) {( function($) { $(document).ready(function() { // jQuery wrapper
hideBlocks(); var checkHide = (window.location.href); if(checkHide == 'http://www.peacepharm.org/plans' || checkHide == 'http://peacepharm.org/plans') { $('#top_bg').hide(); /* Supports one of the following menu items as var menu * media, author, document, survey, help * *Check see we are on a plan page and save the key as a cookie *grab the bit of the url that comes after /plans/ * var href = location.href; // get the url */ // Hides to run when ** any button ** is pressed
$('.region-user2').hide(); $('.region-user3').hide(); $('#plan-extra-bar').hide(); //$('#top_bg').hide(); $('.lock-icon').hide(); $('#book-navigation-3').hide(); // use to hide nav when JS is implimented $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); }
var href = window.location.href.slice(window.location.href); var split = href.split('/plans/'); // split the string; var afterSplit = 'Not a plan'; if(split[1] != null) { afterSplit = split[1]; var urlCode = $.trim(afterSplit); //urlCode = urlTemp.split('#'); //alert('After the url split: ' + urlCode); }
if(afterSplit != 'Not a plan') { $('#top_bg').hide(); }
// If everything went well shows split[1], if not then de default error message is shown
//clean white space
//get the code off the form clean displayCode = $.trim($('.field-name-field-code .field-items .field-item').text()); //alert('Code on the page: ' + displayCode);
// setup the survey var userId = $.trim($('#this-user').text()); var userRealname = $.trim($('#this-user-name').text());
// setup for survey iframe to call back with correct vars (tokens don't work they need to be processed by PHP not JS ) var surveyPrep = ('<iframe class="autoHeight" allowfullscreen="" frameborder="0" height="900px" width="995" id="i-survey" scrolling="off"' + 'src="http://peacepharm.org/limesurvey/index.php?sid=11647' + '&lang=en' + '&11647X14X225=Generated for User No. - ' + userId + ' Real Name - ' + userRealname + ' for evaluation of plan code ' + displayCode + '.' + '&11647X14X2161=' + userId + '&11647X14X2162=' + displayCode + '"' + 'style="margin:0% auto 0% auto;">If you see this your browser does not support iframes</iframe>');
$('#poke-survey').append(surveyPrep);
if($.cookie('tbp-survey') == 'load') { alert('Defined Reload Page -- My ID= ' + userId + ' userRealname= ' + userRealname); //|| planStatus.survey == 'on' $('.region-user3').show(); $.cookie('tbp-survey', ''); planStatus.survey = 'on'; }
//alert(menu);
// media & author information swap if(menu == 'media') { $.cookie('tbp-menu', 'media'); if(urlCode == displayCode) { showDocs(); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); } else { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]); window.open(splitx[0], "_parent"); //showDocs(); //happens when a plan page is loaded in all cases } }
if(menu == 'author') { $.cookie('tbp-menu', 'media'); //alert('urlcode: ' + urlCode); //alert('display code: ' + displayCode); if(urlCode == displayCode) { showProfile(); } else if(urlCode != displayCode) { //alert('oh no!'); var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; //alert ('split x0: ' + splitx[0]); //alert ('split x1: ' + splitx[1]);
window.open(splitx[0], "_parent"); } else { alert('An unknown error has occurred. Error 202'); } }
// co-ment document menu on off if(menu == 'document') { docUrl = ('../plans/' + displayCode + coment); $.cookie('tbp-menu', 'loadDoc'); $.cookie('tbp-document', docUrl); //alert('plan status set as: ' + planStatus.url); //alert('docUrl the plan call url: ' + docUrl); //what is called var loadUrl = $.cookie('tbp-document'); $.cookie('protect', '');
//alert('Warning systen update in process documents are not availiable for 8 hours'); //loadUrl from cookie -- ' + docUrl);
window.open(docUrl, "_parent"); //alert('plan status set as: ' + planStatus.url);
}
// survey menu on settings protect = $.cookie('protect'); if(menu == 'off-survey') { $.cookie('tbp-menu', 'survey'); //alert('Plan status.survey == ' + planStatus.survey); if(planStatus.survey == 'on') { $('.region-user3').hide(); planStatus.survey = 'off'; }
else if(planStatus.survey == 'off') { $('.region-user3').show(); planStatus.survey = 'on'; }
/* else if (!(protect == 'survey')){ if(planStatus.survey == 'load') { if(urlCode == displayCode) { $('.region-user3').hide(); $('#poke-survey').append(surveyPrep); planStatus.survey = 'off'; $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); alert('Load from media page - ' + planStatus.survey); }
else if (!(urlCode == displayCode )) { var href = window.location.href.slice(window.location.href); var splitx = href.split('-'); // split the string; if(splitx[1] != undefined) { // set reload cookie $.cookie('tbp-menu', 'loadSurvey'); var tbpPath = (splitx[0]); $.cookie('tbp-document', tbpPath); alert ('tbp-document url cookie - ' + $.cookie('tbp-document')); alert('Load from doc page - ' + planStatus.survey); $.cookie('protect', 'survey'); alert ('Protect cookie - ' + $.cookie('protect')); window.location.reload() } }
}
}*/ }
// help menu on off if(menu == 'help') { $.cookie('tbp-document', 'media');
if (planStatus.help == 'on' ){ $('.region-user2').hide(); switchval = 'off'; //alert('Turn off: ' + planStatus.help); } if(planStatus.help == 'off' || !planStatus.help) { $('.region-user3').hide(); $('.region-user2').show(); switchval = 'on'; } //run switches planStatus.help = switchval; switch1 = switchval; planStatus.survey = switchval; //alert('Turn on: ' + planStatus.help);
}
//end wrapper }); }(jQuery)); }
//--------------------------------- Following are functions for plan page ---------------------------------------------//
function hideBlocks() {( function($) { $(document).ready(function() { // jQuery wrapper //$('.region-user3').hide(); //$('.region-user2').hide(); $('#plan-extra-bar').hide(); $('.lock-icon').hide(); //end wrapper }); }(jQuery)); }
function showDocs() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').show(); $('.field-name-body').show(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').hide(); $('.field-name-field-profile').hide(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').hide(); $('.field-name-field-facebook-group').hide(); $('.field-name-field-facebook-page').hide(); $('.field-name-field-author-skype').hide(); $('#comments').show(); $('#plan-img').css('visibility', 'hidden'); $('#author-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
function showProfile() {( function($) { $(document).ready(function() { // jQuery wrapper $('.region-user3').hide(); $('.rate-widget').hide(); $('.field-name-body').hide(); $('.field-name-field-video-url').hide(); $('.field-name-field-author').show(); $('.field-name-field-profile').show(); $('.field-name-field-url-survey').hide(); $('.field-name-field-www-site').show(); $('.field-name-field-facebook-group').show(); $('.field-name-field-facebook-page').show(); $('.field-name-field-author-skype').show(); $('#comments').hide(); $('#author-img').css('visibility', 'hidden'); $('#plan-img').css('visibility', 'visible'); planStatus.survey = 'off'; planStatus.help = 'off'; //end wrapper }); }(jQuery)); }
* Richard Damon Richard@Damon-Family.org [121113 18:15]:
On 11/13/12 9:33 PM, Tim Johnson wrote:
Each virtual host in apache has its own configuration for many of the settings that apache uses, this is WHY you use multiple vhost, so you can change settings, like document root and CGI settings. Some settings can be set to replicate to all hosts/virtual hosts on the system, but settings define within one host don't copy to others.
To recap, this is a bitnami install, and it turns out that bitnami had installed its own apache (along with its own mysql) and by running find against httpd.conf, I found the drupal apache directory with its own httpd.conf, noted the scriptalias path and copied the test script to that directory and now we have a solution to the Not Found error.
I want to thank everybody for their help. I really appreciate it. cheers
A couple of weeks ago I could upload images, but now I can't. I'm getting a 406 error. At first I thought it was related to me trying to set up a slide show gallery. I now see that even on my blog entry I can not upload an image.
Here are the Headers and such:
POST /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax HTTP/1.1 Host www.gypsyfarm.com http://www.gypsyfarm.com User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed... http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay Content-Length 10510 Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx; mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F%2Fwww.gypsyfarm.com%2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A%22www.gypsyfarm.com%22%7D; SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o; has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 Pragma no-cache Cache-Control no-cache
(Status-Line) HTTP/1.1 406 Not Acceptable Date Mon, 10 Dec 2012 13:27:31 GMT Server LiteSpeed Connection Keep-Alive Keep-Alive timeout=5, max=100 Cache-Control private, no-cache, max-age=0 Pragma no-cache Content-Type text/html Content-Length 372
an AJAX HTTP error occurred. HTTP Result Code: 406 Debugging information follows. Path: /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax StatusText: Not Acceptable ResponseText: 406 Not Acceptable
406 Not Acceptable
This request is not acceptable Powered By LiteSpeed Web Server LiteSpeed Technologies is not responsible for administration and contents of this web site!
I'm not sure where to start to figure this out. I've Googled 406 error but nothing I read was of much help to me.
Any one can help as to where I should start? I did any module I recently added related to slide shows. Again, this seems to affect all upload of images on the site.
Pat
Add new comment http://drupal.org/comment/reply/1862912#comment-form ? Categories: Post installation http://drupal.org/forum/22, Drupal 7.x http://drupal.org/taxonomy/term/120
Contact your support of your web hosting
On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry drupal@gypsyfarm.com wrote:
A couple of weeks ago I could upload images, but now I can't. I'm getting a 406 error. At first I thought it was related to me trying to set up a slide show gallery. I now see that even on my blog entry I can not upload an image.
Here are the Headers and such:
POST /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax HTTP/1.1 Host www.gypsyfarm.com User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay Content-Length 10510 Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx; mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F% 2Fwww.gypsyfarm.com %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A% 22www.gypsyfarm.com%22%7D; SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o; has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 Pragma no-cache Cache-Control no-cache
(Status-Line) HTTP/1.1 406 Not Acceptable Date Mon, 10 Dec 2012 13:27:31 GMT Server LiteSpeed Connection Keep-Alive Keep-Alive timeout=5, max=100 Cache-Control private, no-cache, max-age=0 Pragma no-cache Content-Type text/html Content-Length 372
an AJAX HTTP error occurred. HTTP Result Code: 406 Debugging information follows. Path: /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax StatusText: Not Acceptable ResponseText: 406 Not Acceptable
406 Not Acceptable
This request is not acceptable Powered By LiteSpeed Web Server LiteSpeed Technologies is not responsible for administration and contents of this web site!
I'm not sure where to start to figure this out. I've Googled 406 error but nothing I read was of much help to me.
Any one can help as to where I should start? I did any module I recently added related to slide shows. Again, this seems to affect all upload of images on the site.
Pat Add new comment http://drupal.org/comment/reply/1862912#comment-form ⋅ Categories: Post installation http://drupal.org/forum/22, Drupal 7.xhttp://drupal.org/taxonomy/term/120
-- [ Drupal support list | http://lists.drupal.org/ ]
I did contact them and opened a ticket, but I was not sure if the issue was related to Drupal or not and they didn't either so I ended up closing the ticket.
When I contact them again is there a specific issue I should ask them to address?
Pat
On 12/10/2012 4:00 PM, Lenny Rogers wrote:
Contact your support of your web hosting
On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry drupal@gypsyfarm.com wrote:
A couple of weeks ago I could upload images, but now I can't. I'm getting a 406 error. At first I thought it was related to me trying to set up a slide show gallery. I now see that even on my blog entry I can not upload an image.
Here are the Headers and such:
POST /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax HTTP/1.1 Host www.gypsyfarm.com User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay Content-Length 10510 Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx; mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F% 2Fwww.gypsyfarm.com %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A% 22www.gypsyfarm.com%22%7D; SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o; has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 Pragma no-cache Cache-Control no-cache
(Status-Line) HTTP/1.1 406 Not Acceptable Date Mon, 10 Dec 2012 13:27:31 GMT Server LiteSpeed Connection Keep-Alive Keep-Alive timeout=5, max=100 Cache-Control private, no-cache, max-age=0 Pragma no-cache Content-Type text/html Content-Length 372
an AJAX HTTP error occurred. HTTP Result Code: 406 Debugging information follows. Path: /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax StatusText: Not Acceptable ResponseText: 406 Not Acceptable
406 Not Acceptable
This request is not acceptable Powered By LiteSpeed Web Server LiteSpeed Technologies is not responsible for administration and contents of this web site!
I'm not sure where to start to figure this out. I've Googled 406 error but nothing I read was of much help to me.
Any one can help as to where I should start? I did any module I recently added related to slide shows. Again, this seems to affect all upload of images on the site.
Pat Add new comment http://drupal.org/comment/reply/1862912#comment-form ? Categories: Post installation http://drupal.org/forum/22, Drupal 7.xhttp://drupal.org/taxonomy/term/120
-- [ Drupal support list | http://lists.drupal.org/ ]
I
Well Opened another ticket with my web hosting company .
Since they wanted to duplicate the problem, I ended up setting up a dummy user on my site. I changed permissions to allow authenticated users to create blog entries.
Oddly enough I did not see when logged in as regular authenticated user any menu item to create a blog entry.
So I just told them to navigate to /node/add once they are logged in to get to the blog entry page and try to upload a photo with a blog entry to duplicate the error.
Pat
On 12/11/2012 9:18 AM, Pat Newberry wrote:
I did contact them and opened a ticket, but I was not sure if the issue was related to Drupal or not and they didn't either so I ended up closing the ticket.
When I contact them again is there a specific issue I should ask them to address?
Pat
On 12/10/2012 4:00 PM, Lenny Rogers wrote:
Contact your support of your web hosting
On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry drupal@gypsyfarm.com wrote:
A couple of weeks ago I could upload images, but now I can't. I'm getting a 406 error. At first I thought it was related to me trying to set up a slide show gallery. I now see that even on my blog entry I can not upload an image.
Here are the Headers and such:
POST /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax HTTP/1.1 Host www.gypsyfarm.com User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay
Content-Length 10510 Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx;
mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F%
2Fwww.gypsyfarm.com %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A% 22www.gypsyfarm.com%22%7D; SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o;
has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 Pragma no-cache Cache-Control no-cache
(Status-Line) HTTP/1.1 406 Not Acceptable Date Mon, 10 Dec 2012 13:27:31 GMT Server LiteSpeed Connection Keep-Alive Keep-Alive timeout=5, max=100 Cache-Control private, no-cache, max-age=0 Pragma no-cache Content-Type text/html Content-Length 372
an AJAX HTTP error occurred. HTTP Result Code: 406 Debugging information follows. Path: /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax StatusText: Not Acceptable ResponseText: 406 Not Acceptable
406 Not Acceptable
This request is not acceptable Powered By LiteSpeed Web Server LiteSpeed Technologies is not responsible for administration and contents of this web site!
I'm not sure where to start to figure this out. I've Googled 406 error but nothing I read was of much help to me.
Any one can help as to where I should start? I did any module I recently added related to slide shows. Again, this seems to affect all upload of images on the site.
Pat Add new comment http://drupal.org/comment/reply/1862912#comment-form ? Categories: Post installation http://drupal.org/forum/22, Drupal 7.xhttp://drupal.org/taxonomy/term/120
-- [ Drupal support list | http://lists.drupal.org/ ]
I
Well after setting up an account my hosting site support folks send me an email today saying they uploaded a file and ask if I still had the problem.
I went to the node link they sent and lo and behold, I found out that they did upload a file.
Well then I tried myself, but still got the same dang message.
Odd. But then just for giggles, I pressed save and lo and behold when I went back to the node, the image was there.
So at least I have a work around. I'm tempted to do another install of drupal (fresh) at a higher directory level) and start from scratch just to verify it's not my drupal installation.
So to recap 1.) when I try to upload and image for my blog, I get a http 406 error
Path: /file/ajax/field_image/und/form-aqVfBkO3W3EanT1FtRcU4Vpw_EvF6JrrFNI-WSDN2yM StatusText: n/a ResponseText: 406 Not Acceptable
2.) when I try very small files (e.g. 3 kb) I do not get the error and the file loads.
3.) If I ignore the 406 error when attempting to upload images (closing the error alert box) , press save then go back to edit of the node, the file / image is there and I can then insert it the blog posting.
Very strange... Very Strange...
Pat
On 12/12/2012 11:40 AM, Pat Newberry wrote:
Well Opened another ticket with my web hosting company .
Since they wanted to duplicate the problem, I ended up setting up a dummy user on my site. I changed permissions to allow authenticated users to create blog entries.
Oddly enough I did not see when logged in as regular authenticated user any menu item to create a blog entry.
So I just told them to navigate to /node/add once they are logged in to get to the blog entry page and try to upload a photo with a blog entry to duplicate the error.
Pat
On 12/11/2012 9:18 AM, Pat Newberry wrote:
I did contact them and opened a ticket, but I was not sure if the issue was related to Drupal or not and they didn't either so I ended up closing the ticket.
When I contact them again is there a specific issue I should ask them to address?
Pat
On 12/10/2012 4:00 PM, Lenny Rogers wrote:
Contact your support of your web hosting
On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry drupal@gypsyfarm.com wrote:
A couple of weeks ago I could upload images, but now I can't. I'm getting a 406 error. At first I thought it was related to me trying to set up a slide show gallery. I now see that even on my blog entry I can not upload an image.
Here are the Headers and such:
POST /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax HTTP/1.1 Host www.gypsyfarm.com User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay
Content-Length 10510 Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx;
mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F%
2Fwww.gypsyfarm.com %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A%
22www.gypsyfarm.com%22%7D; SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o;
has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 Pragma no-cache Cache-Control no-cache
(Status-Line) HTTP/1.1 406 Not Acceptable Date Mon, 10 Dec 2012 13:27:31 GMT Server LiteSpeed Connection Keep-Alive Keep-Alive timeout=5, max=100 Cache-Control private, no-cache, max-age=0 Pragma no-cache Content-Type text/html Content-Length 372
an AJAX HTTP error occurred. HTTP Result Code: 406 Debugging information follows. Path: /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax StatusText: Not Acceptable ResponseText: 406 Not Acceptable
406 Not Acceptable
This request is not acceptable Powered By LiteSpeed Web Server LiteSpeed Technologies is not responsible for administration and contents of this web site!
I'm not sure where to start to figure this out. I've Googled 406 error but nothing I read was of much help to me.
Any one can help as to where I should start? I did any module I recently added related to slide shows. Again, this seems to affect all upload of images on the site.
Pat Add new comment http://drupal.org/comment/reply/1862912#comment-form ? Categories: Post installation http://drupal.org/forum/22, Drupal 7.xhttp://drupal.org/taxonomy/term/120
-- [ Drupal support list | http://lists.drupal.org/ ]
I
Since this appears to be only AJAX related, have you tried using another browser to see if it happens? It sounds like something in your browser messing with the AJAX request headers.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/13/2012 2:37 PM, Pat Newberry wrote:
Well after setting up an account my hosting site support folks send me an email today saying they uploaded a file and ask if I still had the problem.
I went to the node link they sent and lo and behold, I found out that they did upload a file.
Well then I tried myself, but still got the same dang message.
Odd. But then just for giggles, I pressed save and lo and behold when I went back to the node, the image was there.
So at least I have a work around. I'm tempted to do another install of drupal (fresh) at a higher directory level) and start from scratch just to verify it's not my drupal installation.
So to recap 1.) when I try to upload and image for my blog, I get a http 406 error
Path: /file/ajax/field_image/und/form-aqVfBkO3W3EanT1FtRcU4Vpw_EvF6JrrFNI-WSDN2yM StatusText: n/a ResponseText: 406 Not Acceptable
2.) when I try very small files (e.g. 3 kb) I do not get the error and the file loads.
3.) If I ignore the 406 error when attempting to upload images (closing the error alert box) , press save then go back to edit of the node, the file / image is there and I can then insert it the blog posting.
Very strange... Very Strange...
Pat
On 12/12/2012 11:40 AM, Pat Newberry wrote:
Well Opened another ticket with my web hosting company .
Since they wanted to duplicate the problem, I ended up setting up a dummy user on my site. I changed permissions to allow authenticated users to create blog entries.
Oddly enough I did not see when logged in as regular authenticated user any menu item to create a blog entry.
So I just told them to navigate to /node/add once they are logged in to get to the blog entry page and try to upload a photo with a blog entry to duplicate the error.
Pat
On 12/11/2012 9:18 AM, Pat Newberry wrote:
I did contact them and opened a ticket, but I was not sure if the issue was related to Drupal or not and they didn't either so I ended up closing the ticket.
When I contact them again is there a specific issue I should ask them to address?
Pat
On 12/10/2012 4:00 PM, Lenny Rogers wrote:
Contact your support of your web hosting
On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry drupal@gypsyfarm.com wrote:
A couple of weeks ago I could upload images, but now I can't. I'm getting a 406 error. At first I thought it was related to me trying to set up a slide show gallery. I now see that even on my blog entry I can not upload an image.
Here are the Headers and such:
POST /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax HTTP/1.1 Host www.gypsyfarm.com User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay
Content-Length 10510 Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx;
mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F%
2Fwww.gypsyfarm.com %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A%
22www.gypsyfarm.com%22%7D; SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o;
has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 Pragma no-cache Cache-Control no-cache
(Status-Line) HTTP/1.1 406 Not Acceptable Date Mon, 10 Dec 2012 13:27:31 GMT Server LiteSpeed Connection Keep-Alive Keep-Alive timeout=5, max=100 Cache-Control private, no-cache, max-age=0 Pragma no-cache Content-Type text/html Content-Length 372
an AJAX HTTP error occurred. HTTP Result Code: 406 Debugging information follows. Path: /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax StatusText: Not Acceptable ResponseText: 406 Not Acceptable
406 Not Acceptable
This request is not acceptable Powered By LiteSpeed Web Server LiteSpeed Technologies is not responsible for administration and contents of this web site!
I'm not sure where to start to figure this out. I've Googled 406 error but nothing I read was of much help to me.
Any one can help as to where I should start? I did any module I recently added related to slide shows. Again, this seems to affect all upload of images on the site.
Pat Add new comment http://drupal.org/comment/reply/1862912#comment-form ? Categories: Post installation http://drupal.org/forum/22, Drupal 7.xhttp://drupal.org/taxonomy/term/120
-- [ Drupal support list | http://lists.drupal.org/ ]
I
Figured I give the final out come. I did try several types of browser and both linux and windows machines.
Later I found that even if I got the error, as long as I hit save, the images was actually uploaded.
I found this at drupal.org http://drupal.org/node/1369502
So I turned off javascript like it said, I don't get the error.
So now I turn off javascript, upload the photos, then turn it back on.
Weird, but it works.
Pat
On 12/13/2012 2:55 PM, Jamie Holly wrote:
Since this appears to be only AJAX related, have you tried using another browser to see if it happens? It sounds like something in your browser messing with the AJAX request headers.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/13/2012 2:37 PM, Pat Newberry wrote:
Well after setting up an account my hosting site support folks send me an email today saying they uploaded a file and ask if I still had the problem.
I went to the node link they sent and lo and behold, I found out that they did upload a file.
Well then I tried myself, but still got the same dang message.
Odd. But then just for giggles, I pressed save and lo and behold when I went back to the node, the image was there.
So at least I have a work around. I'm tempted to do another install of drupal (fresh) at a higher directory level) and start from scratch just to verify it's not my drupal installation.
So to recap 1.) when I try to upload and image for my blog, I get a http 406 error
Path: /file/ajax/field_image/und/form-aqVfBkO3W3EanT1FtRcU4Vpw_EvF6JrrFNI-WSDN2yM StatusText: n/a ResponseText: 406 Not Acceptable
2.) when I try very small files (e.g. 3 kb) I do not get the error and the file loads.
3.) If I ignore the 406 error when attempting to upload images (closing the error alert box) , press save then go back to edit of the node, the file / image is there and I can then insert it the blog posting.
Very strange... Very Strange...
Pat
On 12/12/2012 11:40 AM, Pat Newberry wrote:
Well Opened another ticket with my web hosting company .
Since they wanted to duplicate the problem, I ended up setting up a dummy user on my site. I changed permissions to allow authenticated users to create blog entries.
Oddly enough I did not see when logged in as regular authenticated user any menu item to create a blog entry.
So I just told them to navigate to /node/add once they are logged in to get to the blog entry page and try to upload a photo with a blog entry to duplicate the error.
Pat
On 12/11/2012 9:18 AM, Pat Newberry wrote:
I did contact them and opened a ticket, but I was not sure if the issue was related to Drupal or not and they didn't either so I ended up closing the ticket.
When I contact them again is there a specific issue I should ask them to address?
Pat
On 12/10/2012 4:00 PM, Lenny Rogers wrote:
Contact your support of your web hosting
On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry drupal@gypsyfarm.com wrote:
A couple of weeks ago I could upload images, but now I can't. I'm getting a 406 error. At first I thought it was related to me trying to set up a slide show gallery. I now see that even on my blog entry I can not upload an image.
Here are the Headers and such:
POST /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax HTTP/1.1 Host www.gypsyfarm.com User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay
Content-Length 10510 Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx;
mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F%
2Fwww.gypsyfarm.com %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A%
22www.gypsyfarm.com%22%7D; SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o;
has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 Pragma no-cache Cache-Control no-cache
(Status-Line) HTTP/1.1 406 Not Acceptable Date Mon, 10 Dec 2012 13:27:31 GMT Server LiteSpeed Connection Keep-Alive Keep-Alive timeout=5, max=100 Cache-Control private, no-cache, max-age=0 Pragma no-cache Content-Type text/html Content-Length 372
an AJAX HTTP error occurred. HTTP Result Code: 406 Debugging information follows. Path: /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax StatusText: Not Acceptable ResponseText: 406 Not Acceptable
406 Not Acceptable
This request is not acceptable Powered By LiteSpeed Web Server LiteSpeed Technologies is not responsible for administration and contents of this web site!
I'm not sure where to start to figure this out. I've Googled 406 error but nothing I read was of much help to me.
Any one can help as to where I should start? I did any module I recently added related to slide shows. Again, this seems to affect all upload of images on the site.
Pat Add new comment http://drupal.org/comment/reply/1862912#comment-form ? Categories: Post installation http://drupal.org/forum/22, Drupal 7.xhttp://drupal.org/taxonomy/term/120
-- [ Drupal support list | http://lists.drupal.org/ ]
I
You might have something else Javascript messing with it. I had a very similar problem last year on a client's site. Turned out it was a Twitter widget that messed with the AJAX calls (actual widget supplied by Twitter). I disabled that widget on node forms and everything started working fine again.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/16/2012 12:45 PM, Pat Newberry wrote:
Figured I give the final out come. I did try several types of browser and both linux and windows machines.
Later I found that even if I got the error, as long as I hit save, the images was actually uploaded.
I found this at drupal.org http://drupal.org/node/1369502
So I turned off javascript like it said, I don't get the error.
So now I turn off javascript, upload the photos, then turn it back on.
Weird, but it works.
Pat
On 12/13/2012 2:55 PM, Jamie Holly wrote:
Since this appears to be only AJAX related, have you tried using another browser to see if it happens? It sounds like something in your browser messing with the AJAX request headers.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/13/2012 2:37 PM, Pat Newberry wrote:
Well after setting up an account my hosting site support folks send me an email today saying they uploaded a file and ask if I still had the problem.
I went to the node link they sent and lo and behold, I found out that they did upload a file.
Well then I tried myself, but still got the same dang message.
Odd. But then just for giggles, I pressed save and lo and behold when I went back to the node, the image was there.
So at least I have a work around. I'm tempted to do another install of drupal (fresh) at a higher directory level) and start from scratch just to verify it's not my drupal installation.
So to recap 1.) when I try to upload and image for my blog, I get a http 406 error
Path: /file/ajax/field_image/und/form-aqVfBkO3W3EanT1FtRcU4Vpw_EvF6JrrFNI-WSDN2yM StatusText: n/a ResponseText: 406 Not Acceptable
2.) when I try very small files (e.g. 3 kb) I do not get the error and the file loads.
3.) If I ignore the 406 error when attempting to upload images (closing the error alert box) , press save then go back to edit of the node, the file / image is there and I can then insert it the blog posting.
Very strange... Very Strange...
Pat
On 12/12/2012 11:40 AM, Pat Newberry wrote:
Well Opened another ticket with my web hosting company .
Since they wanted to duplicate the problem, I ended up setting up a dummy user on my site. I changed permissions to allow authenticated users to create blog entries.
Oddly enough I did not see when logged in as regular authenticated user any menu item to create a blog entry.
So I just told them to navigate to /node/add once they are logged in to get to the blog entry page and try to upload a photo with a blog entry to duplicate the error.
Pat
On 12/11/2012 9:18 AM, Pat Newberry wrote:
I did contact them and opened a ticket, but I was not sure if the issue was related to Drupal or not and they didn't either so I ended up closing the ticket.
When I contact them again is there a specific issue I should ask them to address?
Pat
On 12/10/2012 4:00 PM, Lenny Rogers wrote:
Contact your support of your web hosting
On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry drupal@gypsyfarm.com wrote:
> A couple of weeks ago I could upload images, but now I can't. I'm > getting a 406 error. At first I thought it was related to me > trying to set > up a slide show gallery. I now see that even on my blog entry I > can not > upload an image. > > Here are the Headers and such: > > POST > /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax > HTTP/1.1 > Host www.gypsyfarm.com > User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) > Gecko/20100101 > Firefox/17.0 > Accept application/json, text/javascript, */*; q=0.01 > Accept-Language en-US,en;q=0.5 > Accept-Encoding gzip, deflate > Connection keep-alive > Content-Type application/x-www-form-urlencoded; charset=UTF-8 > X-Requested-With XMLHttpRequest > Referer > http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay > > Content-Length 10510 > Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; > __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; > __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx; > > mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F% > > 2Fwww.gypsyfarm.com > %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A% > > 22www.gypsyfarm.com%22%7D; > SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o; > > has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 > Pragma no-cache > Cache-Control no-cache > > (Status-Line) HTTP/1.1 406 Not Acceptable > Date Mon, 10 Dec 2012 13:27:31 GMT > Server LiteSpeed > Connection Keep-Alive > Keep-Alive timeout=5, max=100 > Cache-Control private, no-cache, max-age=0 > Pragma no-cache > Content-Type text/html > Content-Length 372 > > an AJAX HTTP error occurred. > HTTP Result Code: 406 > Debugging information follows. > Path: > /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax > StatusText: Not Acceptable > ResponseText: > 406 Not Acceptable > > 406 Not Acceptable > > This request is not acceptable > Powered By LiteSpeed Web Server > LiteSpeed Technologies is not responsible for administration and > contents > of this web site! > > I'm not sure where to start to figure this out. I've Googled 406 > error but > nothing I read was of much help to me. > > Any one can help as to where I should start? > I did any module I recently added related to slide shows. Again, > this > seems to affect all upload of images on the site. > > Pat > Add new comment > http://drupal.org/comment/reply/1862912#comment-form ? > Categories: > Post installation http://drupal.org/forum/22, Drupal > 7.xhttp://drupal.org/taxonomy/term/120 > > -- > [ Drupal support list | http://lists.drupal.org/ ] >
I
Well that thought did occur to me. I didn't see anything too strange when I looked, but just to be sure I set up a fresh instance of Drupal in a sub directory of my hosting site and I got the error there as well.
Also I set up an account on drupalgardens and was able to upload an image there and I my father has a web site with drupal installed and I was able to upload an image too. All cases from the same machine that I'm getting the 406 error. Thus it seems rather specific to this site.
My time is about up with this hosting site and well since I don't have shell access where I'm at now, I figured might be a good time to move.
Pat
On 12/16/2012 2:22 PM, Jamie Holly wrote:
You might have something else Javascript messing with it. I had a very similar problem last year on a client's site. Turned out it was a Twitter widget that messed with the AJAX calls (actual widget supplied by Twitter). I disabled that widget on node forms and everything started working fine again.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/16/2012 12:45 PM, Pat Newberry wrote:
Figured I give the final out come. I did try several types of browser and both linux and windows machines.
Later I found that even if I got the error, as long as I hit save, the images was actually uploaded.
I found this at drupal.org http://drupal.org/node/1369502
So I turned off javascript like it said, I don't get the error.
So now I turn off javascript, upload the photos, then turn it back on.
Weird, but it works.
Pat
On 12/13/2012 2:55 PM, Jamie Holly wrote:
Since this appears to be only AJAX related, have you tried using another browser to see if it happens? It sounds like something in your browser messing with the AJAX request headers.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/13/2012 2:37 PM, Pat Newberry wrote:
Well after setting up an account my hosting site support folks send me an email today saying they uploaded a file and ask if I still had the problem.
I went to the node link they sent and lo and behold, I found out that they did upload a file.
Well then I tried myself, but still got the same dang message.
Odd. But then just for giggles, I pressed save and lo and behold when I went back to the node, the image was there.
So at least I have a work around. I'm tempted to do another install of drupal (fresh) at a higher directory level) and start from scratch just to verify it's not my drupal installation.
So to recap 1.) when I try to upload and image for my blog, I get a http 406 error
Path: /file/ajax/field_image/und/form-aqVfBkO3W3EanT1FtRcU4Vpw_EvF6JrrFNI-WSDN2yM StatusText: n/a ResponseText: 406 Not Acceptable
2.) when I try very small files (e.g. 3 kb) I do not get the error and the file loads.
3.) If I ignore the 406 error when attempting to upload images (closing the error alert box) , press save then go back to edit of the node, the file / image is there and I can then insert it the blog posting.
Very strange... Very Strange...
Pat
On 12/12/2012 11:40 AM, Pat Newberry wrote:
Well Opened another ticket with my web hosting company .
Since they wanted to duplicate the problem, I ended up setting up a dummy user on my site. I changed permissions to allow authenticated users to create blog entries.
Oddly enough I did not see when logged in as regular authenticated user any menu item to create a blog entry.
So I just told them to navigate to /node/add once they are logged in to get to the blog entry page and try to upload a photo with a blog entry to duplicate the error.
Pat
On 12/11/2012 9:18 AM, Pat Newberry wrote:
I did contact them and opened a ticket, but I was not sure if the issue was related to Drupal or not and they didn't either so I ended up closing the ticket.
When I contact them again is there a specific issue I should ask them to address?
Pat
On 12/10/2012 4:00 PM, Lenny Rogers wrote: > Contact your support of your web hosting > > On Mon, Dec 10, 2012 at 9:39 PM, Pat Newberry > drupal@gypsyfarm.com wrote: > >> A couple of weeks ago I could upload images, but now I can't. >> I'm >> getting a 406 error. At first I thought it was related to me >> trying to set >> up a slide show gallery. I now see that even on my blog entry I >> can not >> upload an image. >> >> Here are the Headers and such: >> >> POST >> /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax >> HTTP/1.1 >> Host www.gypsyfarm.com >> User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) >> Gecko/20100101 >> Firefox/17.0 >> Accept application/json, text/javascript, */*; q=0.01 >> Accept-Language en-US,en;q=0.5 >> Accept-Encoding gzip, deflate >> Connection keep-alive >> Content-Type application/x-www-form-urlencoded; charset=UTF-8 >> X-Requested-With XMLHttpRequest >> Referer >> http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/ed...http://www.gypsyfarm.com/admin/structure/views/view/image_gallery_iii/edit?render=overlay >> >> Content-Length 10510 >> Cookie Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; >> __utma=68804615.1924210912.1334177271.1355103170.1355145954.287; >> __utmz=68804615.1348501291.200.7.utmcsr=pnewberry.dev.habitat.org|utmccn=(referral)|utmcmd=referral|utmcct=/blog/article109.aspx; >> >> mp_d21cb8a9f34838c02aeec897b3728a94_mixpanel=%7B%22distinct_id%22%3A%2213b06813cb6132-0ffe7a842ff0ee8-47574134-13c680-13b06813cb7285%22%2C%22%24initial_referrer%22%3A%22http%3A%2F% >> >> 2Fwww.gypsyfarm.com >> %2Fadmin%2Fstructure%2Ftypes%22%2C%22%24initial_referring_domain%22%3A% >> >> 22www.gypsyfarm.com%22%7D; >> SESS6fcc60056c800253f4b9ad47fd84e52f=szAwpR3HHNEK1xq-CbX4k5UkJmaoo7r6joenItke_4o; >> >> has_js=1; __utmb=68804615.1.10.1355145954; __utmc=68804615 >> Pragma no-cache >> Cache-Control no-cache >> >> (Status-Line) HTTP/1.1 406 Not Acceptable >> Date Mon, 10 Dec 2012 13:27:31 GMT >> Server LiteSpeed >> Connection Keep-Alive >> Keep-Alive timeout=5, max=100 >> Cache-Control private, no-cache, max-age=0 >> Pragma no-cache >> Content-Type text/html >> Content-Length 372 >> >> an AJAX HTTP error occurred. >> HTTP Result Code: 406 >> Debugging information follows. >> Path: >> /admin/structure/views/view/image_gallery_iii/preview/page_1/ajax >> StatusText: Not Acceptable >> ResponseText: >> 406 Not Acceptable >> >> 406 Not Acceptable >> >> This request is not acceptable >> Powered By LiteSpeed Web Server >> LiteSpeed Technologies is not responsible for administration >> and contents >> of this web site! >> >> I'm not sure where to start to figure this out. I've Googled >> 406 error but >> nothing I read was of much help to me. >> >> Any one can help as to where I should start? >> I did any module I recently added related to slide shows. >> Again, this >> seems to affect all upload of images on the site. >> >> Pat >> Add new comment >> http://drupal.org/comment/reply/1862912#comment-form ? >> Categories: >> Post installation http://drupal.org/forum/22, Drupal >> 7.xhttp://drupal.org/taxonomy/term/120 >> >> -- >> [ Drupal support list | http://lists.drupal.org/ ] >> > > I