Using Drupal 6.17 + PHP 5.2.6 + jQuery 1.3.2 + Views 2.

When I try to edit and update the basic settings, filters, anything requiring to click "Update Default Display", or even to "save" any new View, views sends me to a page that has a string of code that looks like the code below (in the cite area below or see attached screenshot).

If I click "back" in the browser, and refresh the views UI, the changes have taken effect. I just don't get why it sends me to this page rather than just 'updating' the default settings and staying on the views UI page.

I'm mainly a designer. If anyone can help with this in a way a non-php professional could understand patching this, myself and others like me would appreciate it.

The code below is not the full string of code that views creates. It's much longer.. but this is a short blurb of what happens


{ "replace": { "#views-tab-default": "\x3cdiv class=\"clear-block views-display views-display-default\"\x3e\n      \x3cdiv class=\"top\"\x3e\n    \x3cdiv class=\"inside\"\x3e\n            \x3cspan class=\"display-title\"\x3e\n        Defaults      \x3c/span\x3e\n      \x3cspan class=\"display-description\"\x3e\n        Default settings for this view.      \x3c/span\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n\n    \x3cdiv class=\"left tab-section\"\x3e\n    \x3cdiv class=\"inside\"\x3e\n                    \x3cdiv class=\"views-category\"\x3e\n          \x3cdiv class=\"views-category-title\"\x3eView settings\x3c/div\x3e\n          \x3cdiv class=\"views-category-content\"\x3e\n            \x3cdiv class=\"\"\x3e\n              Description/Tag: \x3ca href=\"/admin/build/views/nojs/details/test\" class=\"views-ajax-link\"\x3etest\x3c/a\x3e            \x3c/div\x3e\n          \x3c/div\x3e\n        \x3c/div\x3e\n      \n       ........
......
......
......
......   \x3c/div\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n\n\x3c/div\x3e", "#views-tab-title-page_1": "Page" }, "changed": true }
CommentFileSizeAuthor
#3 error.pdf26.82 KBpatrick_IRE
error.png70.63 KBpatrick_IRE

Comments

merlinofchaos’s picture

If you see this error it usually means some kind of javascript crash/fail. Check your javascript error log. (ctrl-shift-j in firefox; not sure what you can do in other browsers)

dawehner’s picture

One thing i really don't get


  $items['admin/build/views/%views_ui_js/%/%views_ui_cache'] = $callback + array(
    'page callback' => 'views_ui_ajax_form',
    'page arguments' => array(3, 4, 5),
  );

and

 function views_ui_ajax_form($js, $key, $view, $display_id) {

Something has to be wrong.

patrick_IRE’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new26.82 KB

The string changes based upon the setting that I'm trying to change. Here is a text doc with an entire string when I try to change the Node - Title: attribute

Before Image:
Before

Sends me to a page with the full error - I've attached the PDF with the full error.

I click 'back' and refresh and it gives me this within the Views2 UI:
After

I am using the jQuery Update module to update me to jQuery 1.3.2

Also after checking for javascript errors I found two: Javascript errors

I haven't noticed any CDATA errors before with any of my pages. Of course I have it there so that javascript isn't parsed.

This is the code inside of the CDATA:


<script type="text/javascript"><![CDATA[
startList = function() {
	if (document.all&&document.getElementById) {
		searchnavRoot = document.getElementById("searchnav");
		for (i=0; i<searchnavRoot.childNodes.length; i++) {
			node = searchnavRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;
<!]]></script>
merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

The string you're seeing is the AJAX response and not at all interesting. It is not what I asked for in #1.

merlinofchaos’s picture

Also, in this issue you say you're using PHP 5.2.6; in another issue you're saying you're using PHP 5.3.

This is not consistent, and not at *all* helpful.

patrick_IRE’s picture

Status: Active » Postponed (maintainer needs more info)

I apologize for the inconsistency. I'm using PHP 5.2.6.

I checked the Javascript error log as you had asked and there were two errors.

When I click on the second error with the "(this) is not a function" part, it takes me to this:

Highlighted Area within the .js file

merlinofchaos’s picture

This kind of error usually results from having multiple copies of jquery running simultaneously. Perhaps your theme is doing this?

Search the HTML source for instances of 'jquery.js' to see if this is true.

patrick_IRE’s picture

Bingo. That was it.

Aside from the jQuery Update module that brings me to 1.3.2, I'd previously added jquery.min.1.3.1 to my HTML for a customized jQuery slider on non-admin pages.

For admin pages - which don't need the slider and have their own template - removing the jQuery.min.1.3.1 addition worked.

Thanks for the help. It's much appreciated.

merlinofchaos’s picture

Title: Views 2 Update & Save issue with Drupal 6.17+ PHP 5.2 + jQuery 1.3.2 » Write some javascript to detect this condition and report it
Category: support » task
Status: Postponed (maintainer needs more info) » Active

Changing this to a task to try and find a way to detect and report this condition.

merlinofchaos’s picture

Title: Write some javascript to detect this condition and report it » Write some javascript to detect multiple instances of jquery.js and report it
iamjon’s picture

Priority: Critical » Normal

Updating priority.
This as an unassigned task. If anyone would like to role up their sleeves and take it upon themselves to write a patch it would be awesome

Branndon’s picture

The theme I'm using had this in it:

<script src="<?php print base_path() ?>/misc/jquery.js" type="text/javascript"></script>

I also had jquery_update installed and enabled, so simply removing the above line did the trick for me.

mustanggb’s picture

Status: Active » Closed (won't fix)