mashups with post__in no longer working after upgrade

Home Forums MapPress Support mashups with post__in no longer working after upgrade

Tagged: , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #11412
    James Proctor
    Participant

    Chris, we just updated from MapPressPro beta 2.38.7 to MapPressPro 2.39.7 and my post__in queries (in template files) are also broken, possibly similar to here. I’ve had these queries in through several versions without problem; I realize the syntax is a bit old, but it was working just great up to this update. Here’s an example of what we have in the template (we have several of these, on different custom post template pages, all broken):

    <?php echo do_shortcode(‘[mashup width=”540″ height=”360″ maxZoom=”4″ maptypeid=”hybrid” marker_title=”post” marker_body=”none” directions=”none” overviewmapcontrol=”false” show=”query” show_query=”post_type=any&post__in=’.$mapIDs.'”]’);?>

    and $mapIDs seems to be working fine as well…I echoed the string and it outputs (for one example)

    223,4072,222,5151,14963,15164,15171,15179,15429,15468,15439,12060,2488,2269,3235,636,6632,16918

    I even inserted a smaller number of these IDs in as literals (e.g., “post_type=any&post__in=223,4072”) and it still didn’t work. I’ve removed other parameters to see if they’re the culprit, replaced the show_query with more recent syntax, but nothing works.

    Note that all the rest of my mashups are working fine in templates, just the ones with the post__in logic aren’t.

    Thanks as usual!

    Jim P.

    #11413
    Chris
    Keymaster

    Hi,

    I’ll be happy to look into it.  The query problem with ‘array’ parameters was fixed in 2.39.6, or at least I thought it was.

    Can you provide a link to a page with the problem so I can see what’s getting sent in with the query?

    Also, if you could echo the entire query, and let me know it is, that would be helpful.  I think you could code like:

    <?php echo ‘[mashup width=”540″ height=”360″ maxZoom=”4″ maptypeid=”hybrid” marker_title=”post” marker_body=”none” directions=”none” overviewmapcontrol=”false” show=”query” show_query=”post_type=any&post__in=’.$mapIDs.'”]‘; ?>

    #11418
    James Proctor
    Participant

    Chris, thanks; link to sample page with this code is here. I’ve temporarily uncommented the $mapIDs echo so you’ll see that string at top. What you’ll see is a blank map. The full query code is below; it basically harvests geotagged posts (of several kinds) that were selected by the user. Again, it all worked great up to the upgrade.

    As to your replacement code, can you actually do <?php echo ‘[shortcodegoeshere]’;?> and not include the do_shortcode?? Guess I have stuff to learn ;-).

    Cheers,

    Jim

     

     

    #11429
    Chris
    Keymaster

    Hi,

    The code was to echo the shortcode string, I wanted to see what was being passed to the plugin.

    I was able to check using the sample page and I found the problem: for query argument “post_type=any”, the plugin is sending an array.  WP_Query requires an array for multiple post types, but for “any” it requires a string.

    This is fixed in 2.39.8, which should be out later today.

    Until then, you can get it working by specifying a post type (“post_type=post”) or just removing the “post_type=any” clause from the query.

    Thanks for letting me know about the problem!

    #11430
    James Proctor
    Participant

    Chris, thank you!  I’m using post_type=any as the routine harvests geotags from several post types, including custom posts…will wait for update, and sure appreciate it…

    Jim

    #11432
    Chris
    Keymaster

    Hi Jim,

    Ok, the update will be out soon.  This should also work if you don’t want to wait: “post_type=a,b,c” where a,b,c are your types.

    #11434
    James Proctor
    Participant

    Thanks; this works too!

    Jim

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.