Hi - I'm getting an Unknown Response from Server Error when I try to add any contexts in the Mini Page Contexts section.

Any ideas?

Thanks,
Heather

Comments

merlinofchaos’s picture

Do you have firebug installed?

hdmann’s picture

no.

hdmann’s picture

I looked it up - Firebug that is - and installed it. Heather

merlinofchaos’s picture

Firebug has an option to let you see the server response from an ajax request. It's pretty easy; I think you hit f12 to open up the console, click 'console', and then click the button. It should give a line about the URL hit and the response. Could you paste that information into this issue for me?

Thanks

hdmann’s picture

Here it is...

{ "output": "\x3cform action=\"/panels/common/ajax/add/panel_mini/requiredcontext/mini_test\"  method

=\"post\" id=\"panels-common-edit-requiredcontext-form\"\x3e\n\x3cdiv\x3e\x3cinput type=\"hidden\" name

=\"position\" id=\"edit-position\" value=\"0\"  /\x3e\n\x3cdiv class=\"modal-form clear-block\"\x3e\x3cdiv

 class=\"description\"\x3eA node object.\x3c/div\x3e\x3cinput type=\"hidden\" name=\"requiredcontext

[name]\" id=\"edit-requiredcontext-name\" value=\"node\"  /\x3e\n\x3cdiv class=\"form-item\"\x3e\n \x3clabel

 for=\"edit-requiredcontext-identifier\"\x3eIdentifier: \x3c/label\x3e\n \x3cinput type=\"text\" maxlength

=\"128\" name=\"requiredcontext[identifier]\" id=\"edit-requiredcontext-identifier\"  size=\"60\" value

=\"Node\" class=\"form-text\" /\x3e\n \x3cdiv class=\"description\"\x3eEnter a title to identify this

 context on administrative screens.\x3c/div\x3e\n\x3c/div\x3e\n\x3cdiv class=\"form-item\"\x3e\n \x3clabel

 for=\"edit-requiredcontext-keyword\"\x3eKeyword: \x3c/label\x3e\n \x3cinput type=\"text\" maxlength

=\"128\" name=\"requiredcontext[keyword]\" id=\"edit-requiredcontext-keyword\"  size=\"60\" value=\"node

\" class=\"form-text\" /\x3e\n \x3cdiv class=\"description\"\x3eEnter a keyword to use for substitution

 in titles.\x3c/div\x3e\n\x3c/div\x3e\n\x3c/div\x3e\x3cinput type=\"submit\" name=\"op\" id=\"edit-next

\" value=\"Save\"  class=\"form-submit\" /\x3e\n\x3cinput type=\"hidden\" name=\"form_token\" id=\"edit-panels-common-edit-requiredcontext-form-form-token

\" value=\"14d9482d8a3636379ca7b84452b6d2a8\"  /\x3e\n\x3cinput type=\"hidden\" name=\"form_id\" id=

\"edit-panels-common-edit-requiredcontext-form\" value=\"panels_common_edit_requiredcontext_form\"  

/\x3e\n\n\x3c/div\x3e\x3c/form\x3e\n", "type": "display", "title": "Add required context \"Node\"", "url"

: "http://www.littlewaystosave.com/panels/common/ajax/add/panel_mini/requiredcontext/mini_test" }

Thanks for your help :)

merlinofchaos’s picture

Huh. That is a valid response.

I've seen this before; the server gives a valid response, but for some reason jquery doesn't parse it. This error confuses me greatly.

hdmann’s picture

That makes two of us!

I could try deleting panels and starting again (again). I guess if there's nothing obvious a 'reboot' it is.

Thanks.
Heather

hdmann’s picture

oh - I forgot to say thanks for putting me on to Firebug - that's awesome!

Heather

merlinofchaos’s picture

BTW, are you using an updated jquery.js rather than the default one?

hdmann’s picture

updated.

iamscott’s picture

I'm also getting this error when clicking that "Add argument" button. Is there a known solution/fix for this?

Also, how do I know if I'm using the updated jquery.js version? I'm currently using $Id: jquery.js,v 1.6 2006/12/23. I think on a previous install I used the updated.jquery but functions like collapsible menus stopped working.

Thanks.

hdmann’s picture

I've deleted everything, including the panels database tables - downloaded the module again - reinstalled and I still get the same error.

Any other thoughts?

Thanks,
Heather

floptikal’s picture

Not shure what goes on, but here's a hack that worked for me. There seems to be an issue with some themes, so try swapping themes before adding the panel (garland worked for me), and then swap back to your original theme when your done.

eriktoyra’s picture

I have the exact same problem with "Unknown Response From Server Error". Not only does this affect the "Context" page, it also makes my mini-panels views to show up with empty content (actually they don't show up at all). When I switch to Garland I can see the content in the mini-panels. This is something that must have been introduced in the 5.x-2.0-beta2 release since I did not have these problems in 2.0-alpha14.

This is how my response looks like when pressing the "Add required context" button.

{ "relationships_table": "\x3cdiv class=\"buttons\"\x3e\x3ctable id=\"relationship-add-table\"\x3e\n

\x3ctbody\x3e\n \x3ctr class=\"odd\"\x3e\x3ctd class=\"title\"\x3e\x3cdiv class=\"form-item\"\x3e\n 

\x3cselect name=\"buttons[relationship][item]\" class=\"form-select\" id=\"edit-buttons-relationship-item

\" \x3e\x3coption value=\"term_from_node\"\x3eTerm from node\x3c/option\x3e\x3coption value=\"book_parent

\"\x3eBook parent\x3c/option\x3e\x3c/select\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd class=\"add\" width

=\"60%\"\x3e\x3cinput type=\"submit\" name=\"op\" id=\"edit-buttons-relationship-add\" value=\"Add relationship

\"  class=\"form-submit relationship-add\" /\x3e\n\x3c/td\x3e \x3c/tr\x3e\n\x3c/tbody\x3e\x3c/table\x3e

\n\x3c/div\x3e", "type": "add", "output": "\x3ctr id=\"requiredcontext-row-0\" class=\"requiredcontext-row

 odd\"\x3e\x3ctd class=\"title\"\x3e\x26nbsp;Node\x3c/td\x3e\x3ctd class=\"operation\"\x3e\x3cinput type

=\"image\" class=\"form-submit requiredcontext-settings\" name=\"requiredcontext[settings]\" value=\"Configure

\" id=\"requiredcontext-settings-0\"  src=\"/intranet/modules/panels/images/configure.gif\" alt=\"Configure

 this item\" title=\"Configure this item\" /\x3e\n\x3cinput type=\"image\" class=\"form-submit requiredcontext-up

\" name=\"requiredcontext[up]\" value=\"Up\" id=\"requiredcontext-up-0\"  src=\"/intranet/modules/panels

/images/go-up.png\" alt=\"Move this item up\" title=\"Move this item up\" /\x3e\n\x3cinput type=\"image

\" class=\"form-submit requiredcontext-down\" name=\"requiredcontext[down]\" value=\"Down\" id=\"requiredcontext-down-0

\"  src=\"/intranet/modules/panels/images/go-down.png\" alt=\"Move this item down\" title=\"Move this

 item down\" /\x3e\n\x3cinput type=\"image\" class=\"form-submit requiredcontext-top\" name=\"requiredcontext

[top]\" value=\"Top\" id=\"requiredcontext-top-0\"  src=\"/intranet/modules/panels/images/go-top.png

\" alt=\"Move this item to the top of the list\" title=\"Move this item to the top of the list\" /\x3e

\n\x3cinput type=\"image\" class=\"form-submit requiredcontext-bottom\" name=\"requiredcontext[bottom

]\" value=\"Bottom\" id=\"requiredcontext-bottom-0\"  src=\"/intranet/modules/panels/images/go-bottom

.png\" alt=\"Move this item to the bottom of the list\" title=\"Move this item to the bottom of the list

\" /\x3e\n\x3cinput type=\"image\" class=\"form-submit requiredcontext-remove\" name=\"requiredcontext

[remove]\" value=\"Remove\" id=\"requiredcontext-remove-0\"  src=\"/intranet/modules/panels/images/delete

.png\" alt=\"Remove this item\" title=\"Remove this item\" /\x3e\n\x3c/td\x3e\x3c/tr\x3e", "position"

: 0 }

Any idea of what could be the reason for this? It is clearly theme related in some way but I cannot indentify the exact cause of the problem. What is bugging me more is that the mini-panels doesn't work at all in my theme since 5.x-2.0-beta2. I will be happy to assist in any way to solve this problem. Just let me know how I can help.

DonTino’s picture

same problem here, I'll try to switch the theme first and let you know if it helped

DonTino’s picture

not working, still getting the server error

any help???

Tino

DonTino’s picture

ok I installed firebug as well and did what was told above

however I get the following response:

'Loading... '

nothing changes it just shows 'Loading...', is it a problem on my side?

Tino

jon pugh’s picture

I did some looking into this, since I'm having the same problem...

In the JSON outputted by the server, there is a TAB character in front of everything.

under advice from merlinofchaos, I printed out something from my own custom module, and sure enough, a tab character shows up in front of it.

So there is something somewhere printing a tab character (or displaying it ouside of ?> )

In my setup it was activity.module... at the beginning of the file is a tab character, then <?.

It could be a different module for the rest of you guys. I found it by copying the tab character and searching for "[tab-char]<?"...
it could also be at the end, so search for "?>[tab-char]" also.

I'll post an issue to the activity module.

later,
jon

keesee’s picture

Hi guys,

I decided to play with different settings and found the source of this problem for me. Try changing themes... WOrks in Garlard but not in my custom theme. Doesn't make any sense, but I think that this may be causing it for others.

I'm a Theme dev, noto a php dev - but I hope this helps Merlin and team.

--
COrpX

keesee’s picture

Here's another piece of trouble shooting info - My theme is conflicting with this even if I am using garland as my administrator theme.

Trouble shooting results ...

1. Garland theme - no administrator theme - it worked
2. custom theme - no administrator theme - received unknown Response from Server Error
3. custom theme - Garland theme as administrator theme - received unknown Response from Server Error

What I found weird is that the default site theme is breaking the UI even in cases where the Garland theme (set as admin theme) is being loaded for the panels administration pages.

--
J.

sdboyer’s picture

Keep these reports of when/where you got these js errors coming if you have em, folks - I suspect that jon's info in #18 is gonna prove to take care of most/all of this, but this is a particularly elusive problem, so every little bit of information helps.

2c’s picture

Would it be possible to manually enter contexts into the database for this section? It's make or break functionality for me and I can't isolate the cause of the error. It's possible the error is only affecting the admin page and not the panels themselves, in which case it'd be useful to just enter the values in manually.

ChristieLuv’s picture

Hi everyone! I was getting the same error, what a coinkidink, I'm using a custom template.php as well! I figured out what the issue was at least on my end. It was the code Advanced Profile Kit asks you to install in your template.php when your installing Advanced Profile Kit. I just installed it in the wrong way. Once I checked how to put it in the right way it worked! I was able to add a relationship and everything! So if this is your case you might want to try that out.

This is the code I'm talking about that Advanced Profile Kit asks you to install:

<?php
  if (module_exists('advanced_profile')) {
    $vars = advanced_profile_addvars($hook, $vars);
  }
?>

Here is the link where they ask you to install it:

http://drupal.org/node/214350

Read this to see how to put it in the right way:

http://drupal.org/node/207841

~Christie

2c’s picture

Christieluv,

When you say you had installed it the 'wrong way', could you be a little more specific? What changes did you make?

ChristieLuv’s picture

Hi! I put it in like this, with the php tags included inside my template.php code that already had php tags wrapping it and I forgot to include the _phptemplate_variables function:

<?php
  if (module_exists('advanced_profile')) {
    $vars = advanced_profile_addvars($hook, $vars);
  }
?>

The right way for me to put it in was this:

function _phptemplate_variables($hook, $vars) {
  if (module_exists('advanced_profile')) {
    $vars = advanced_profile_addvars($hook, $vars);
  }

/***EXISTING CODE IN THE FUNCTION, IF ANY***/


  return $vars;
}

BUT the correct way to stick it in is different with every template.php, thats why its a good idea to read the page that explains how to put it in.

You can go ahead and use this code above without reading it if your style doesn't have a template.php yet or if your style does have a template.php but doesn't have this function in it: _phptemplate_variables

~Christie

2c’s picture

Thanks ChristieLuv for responding.

I put the following code at the end of the _phptemplate_variables($hook, $vars) function, but it doesn't solve the issue:


foreach($vars as $key=>$val) {
  $vars[$key] = trim($val);
}
return $vars;

I'm trying to trim excess tab and whitespace characters from each value in the $vars array.

2c’s picture

Is there a program (application or script) that will iterate through every .module file in a folder (and subfolders) that will strip the tab and whitespace characters from them?

That would be very useful, if only to identify the cause of the error as not being from tab and whitespace at the beginning/end of a module file as suggested in #18

rentex’s picture

Im experiencing this in Panels 5.x-2.0-beta3 as well.
Anyone found out what the cause is?

alzander’s picture

The cause for me was the extra tab issue. I didn't find a way to search all modules, but did realize that my custom template.php had an extra tab at the very end after the closing php: "?> "

Removed that, and all is good. Thanks for the great debugging!

socialnicheguru’s picture

i had the exact same issue. I had to switch theme to garland (i guess anything other than my custom theme to configure the group)

avespa’s picture

Version: 5.x-2.0-beta2 » 5.x-2.0-rc1a
Component: Plugins - contexts » Panel pages
Priority: Normal » Critical

Okie, I am having a very similar issue but none of the above issues or suggestions seem to help or apply to me.

I've been building panels the last couple of days with views in them, and I created a new panel with flexible layout, the panel saved fine and worked fine, but when I tried to edit it, I got the Unknown response error, as well as the 'an error occurred while attempting to access the add content modal form. I have not changed anything else. I went through and deleted all of my panels and I get the exact same issues on new panels, effectively making panels UNUSABLE and halting my development like an elephant being dropped on a glass skyscraper - loud and awful.

My firebug output is normal, not visible errors in any logs. It just stopped working.

Thoughts?

avespa’s picture

So it turns out that if I switch my site theme back from my custom theme to bluemarie, the problem(s) go away. Now, here is the sticky bit - I had been using bluemarie as my admin theme, and a custom theme (with custom views, custom php template code etc) as the actual site theme, and without me making changes to the theme, this problem suddenly occured (I'm mostly doing panel pages with views embedded as blocks) - in any event, my astute collegue and I think the issue is that part of the panels' module lives outside the /admin directory, and is subject to wackiness by other custom themes. So, I think the bug here really is...all the stuff should be pulling from the admin directory, and not outside of it.

keesee’s picture

It is very much a theming issue... but I can't put my finger on what. My custom theme contains everything that garland does.... works find in garland and not mine.... hrrrmmm. for those of you experiencing this... would you upload your themes as zip files. I would liketo see several which I know are experiencing this. I don't think its a panels issue, but at least we can post a "don't do this when theming warning" or something along those lines for new Panels users.

thx.
--
J.

socialnicheguru’s picture

for those who are experiencing the issue, did you upgrade to a particular panel version at the time the problem started to occur?

aterchin’s picture

Custom theme, maybe.... I never had this problem until I installed it at my new job where they have a severely modified custom theme and yes, they're getting this error with the panels-page contexts buttons. After reading the custom theme and template.php stuff above, I decided to test that aspect:

On my localhost, where I've never had this problem, I copied the entire garland folder out of core to my theme section, named it garland1, and switched all default and admin themes to use this.

All I had to do to get the error to pop up on the context page was add one space before the <?php at the beginning of the template.php file. Removed the space and all was fine.

using 5.x-2.x-dev on my localhost and 5.x-2.0-rc1a at the job, so I've asked their php people to dig through their custom theme php stuff and look for things like extra spaces, where the issue is still, well...an issue. I'll let you all know the results when we figure out if it was a template file or somewhere else. (Of course others might be having a confilct with another module, javascript, whatever, I wouldn't rule anything out just yet, but here's what I've found so far.) Hope this helps.

alvinet’s picture

No updates? The problem still exist :(
The only way to make il work is use garland theme for the entire site (not only admin view)

Leeteq’s picture

Does this happen with any non-core contributed/custom theme, or does several contributed themes work without this error also?

Leeteq’s picture

Title: Unknown Response From Server Error » Panels gets Unknown Response From Server Error with (some?) custom themes
aterchin’s picture

Now that we fixed the problem, all i can say is re-check your custom modules and template.php file for spaces and tabs at the beginning of the files and get rid of closing php tags in your modules before you look at any other possible reasons from un-hacked contrib modules or otherwise.

A bunch of "drupal specialists" did a bunch of hacky work before I came on board. That fixed it for us. see my comment http://drupal.org/node/213500#comment-1159514

gundarx’s picture

rpmute, thank you. My template.php file (that was worked on by another developer) had a series of spaces at the beginning of the file before the <?php tag. After removing those, the problem went away.

sun.core’s picture

Status: Active » Closed (won't fix)

Sorry, but Panels for D5 will not see any further fixes, since Panels for D6 simply advanced too much and no one cares for D5.