I’m seeing the same issues, WP 3.9.1 and Posts 2 Posts 1.6.3
I have a child theme that contains only a style.css file (with just the WP Style declarations) and a functions.php file. In this file is the following code:
<?php
function map_link_category_connection() {
p2p_register_connection_type( array(
'name' => 'outbound_node_to_node',
'from' => 'node',
'to' => 'node',
'reciprocal' => true,
'duplicate_connections' => true,
'can_create_post' => false,
'fields' => array(
'track' => array(
'title' => 'Track',
'type' => 'select',
'values' => array( 'None', 'Citizen Science', 'Data Production', 'Climate Science', 'Weather Derivatives' )
)
)
) );
}
add_action ('p2p_init', 'map_link_category_connection');
?>
However, when I edit one of my ‘Node’ items, the ‘create connection’ sidebar panel has the persistent spinner when entering text into the ‘Search Nodes’ box.
If I pull up Firefox and look at the console, I see the following, an error in ‘box.js’ on line 372:
"Malformed response" "<div class="menu"><ul><li id="menu-item-2" class=""><a></a></li></ul></div>
{"rows":[{"columns":[{"column":"create","content":"<div data-item-id=\"63\" title=\"http:\/\/slod.com:8080\/?node=financial-markets\">\n\t<span class=\"p2p-icon\"><\/span>\n\tFinancial Markets<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"59\" title=\"http:\/\/slod.com:8080\/?node=standards-wmo\">\n\t<span class=\"p2p-icon\"><\/span>\n\tStandards WMO<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"57\" title=\"http:\/\/slod.com:8080\/?node=policy-legal\">\n\t<span class=\"p2p-icon\"><\/span>\n\tPolicy Legal<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"55\" title=\"http:\/\/slod.com:8080\/?node=met-office\">\n\t<span class=\"p2p-icon\"><\/span>\n\tMet Office<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"53\" title=\"http:\/\/slod.com:8080\/?node=sheffield-weston-park\">\n\t<span class=\"p2p-icon\"><\/span>\n\tSheffield Weston Park<\/div>\n"}]}],"navigation":{"current-page":"1","total-pages":"3","total-pages-raw":3,"prev-inactive":"inactive","next-inactive":"","prev-label":"previous","next-label":"next","of-label":"of"}}" box.js:372
12:46:15.217 "Malformed response" "<div class="menu"><ul><li id="menu-item-2" class=""><a></a></li></ul></div>
"<div class=\"p2p-notice\">No Nodes Found<\/div>"" box.js:372
12:46:43.429 POST https://slod.com:8080/wp-admin/admin-ajax.php [HTTP/1.1 200 OK 1097ms]
12:47:43.433 POST https://slod.com:8080/wp-admin/admin-ajax.php [HTTP/1.1 200 OK 1280ms]
12:49:46.899 POST https://slod.com:8080/wp-admin/admin-ajax.php [HTTP/1.1 200 OK 788ms]
12:50:35.351 POST https://slod.com:8080/wp-admin/admin-ajax.php [HTTP/1.1 200 OK 1025ms]
12:50:36.298 "Malformed response" "<div class="menu"><ul><li id="menu-item-2" class=""><a></a></li></ul></div>
{"rows":[{"columns":[{"column":"create","content":"<div data-item-id=\"63\" title=\"http:\/\/slod.com:8080\/?node=financial-markets\">\n\t<span class=\"p2p-icon\"><\/span>\n\tFinancial Markets<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"59\" title=\"http:\/\/slod.com:8080\/?node=standards-wmo\">\n\t<span class=\"p2p-icon\"><\/span>\n\tStandards WMO<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"57\" title=\"http:\/\/slod.com:8080\/?node=policy-legal\">\n\t<span class=\"p2p-icon\"><\/span>\n\tPolicy Legal<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"55\" title=\"http:\/\/slod.com:8080\/?node=met-office\">\n\t<span class=\"p2p-icon\"><\/span>\n\tMet Office<\/div>\n"}]},{"columns":[{"column":"create","content":"<div data-item-id=\"53\" title=\"http:\/\/slod.com:8080\/?node=sheffield-weston-park\">\n\t<span class=\"p2p-icon\"><\/span>\n\tSheffield Weston Park<\/div>\n"}]}],"navigation":{"current-page":"1","total-pages":"3","total-pages-raw":3,"prev-inactive":"inactive","next-inactive":"","prev-label":"previous","next-label":"next","of-label":"of"}}"
I tried changing the BOM of my functions.php, which was UTF-8 already (but not sure if it had the BOM) – I saved it through OSX TextEdit as UTF-8, which I believe is without a BOM on OSX Mavericks.
I then used the following shell script to strip the BOM:
sed -i .bak '1 s/^\xef\xbb\xbf//' *.php
However, there was no change.
What should be seen in the Ajax response? Should it be a mix of HTML and JSON data? Unless firebug is stripping things out, it seems a little suspect to have a direct inline mix of JavaScript and HTML without block boundaries… could this be what’s causing the response to be described as ‘malformed’?