Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hey, thanks for your suggestion, @tedinoz. My version seems different, so I switched to the Github version. Same error – surmised it must have been elsewhere. Found an errant <div> injection, so everything is working just fine now. Thanks!

    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’?

    @young\ Master and @gooma2 – your problem may be related to a duff distribution of php-apc. I know WPSupercache will try to use it, if installed, and W3TC has options to hook it in.

    Try removing it (assuming you have it). I saw tell-tale errors in my logs about failed cache access. It absolutely killed a box of mine.

    Great – Thanks Simon! MadLab’s tweets are back up again!

    Thread Starter davemee

    (@davemee)

    An update!

    No, nothing. I replaced the entire plugin with the latest version downloaded from here. Still broken in an identical way. Looks like I’ll have to dive in – I have a suspicion it’s throwing some bad data out on the ajax request when navigating months, and something is failing to filter though jQuery properly.

    Although, I would have prefered your solution, smcnutt

    Thread Starter davemee

    (@davemee)

    Thanks, smcnutt – I’ll take a sniff and report back.

    Thread Starter davemee

    (@davemee)

    Okay, so it doesn’t override the WP file types allowed for uploads. So make sure this list is a subset of what you’ve allowed in WordPress.

    Forum: Plugins
    In reply to: Group posts by Category

    SimonJ, filosofo – you guys are stars. Was looking for this. It really should be reimplemented, as it’s an enormousely useful feature – for example, making sense of search results. Shame it was retired in core.

    Thanks again for sharing your solution, guys!

    Thread Starter davemee

    (@davemee)

    Solved!

    WordPress seems to ignore the <enclosure> tag with XML RPC. The only way to generate enclosure tags in the RSS feed is by explicitly placing a link in the post body.

    This isn’t a great solution, as I am planning to place several local files in the post, yet only one should appear as the enclosure, and there seems to be no way to control which file will appear.

    Thanks for reading this thread, and good luck with your XML RPC posting!

Viewing 9 replies - 1 through 9 (of 9 total)