[EventCalendar] 3.0.4 iCal DB corruption?

Alex Tingle alex at firetree.net
Thu Oct 12 08:10:20 UTC 2006


Hi Jim,

On Thu, 12 Oct 2006 02:33:47 -0400
"Jim Galley" wrote:

> I'm using 3.0.4 on a scout site (for a while now, thanks!).  I'm in
> the process of moving the sit to a different server, and noticed that
> the new sites iCal is screwed up.
> 
> old: http://565.incuspace.com/?ec3_vcal
> new: http://troop565.org/?ec3_vcal
> 
> new is a restore of old - are same database, same plugin. new one
> returns the following
> 
> ------------------------------------------------------------
> BEGIN:VCALENDAR
> VERSION:2.0
> X-WR-CALNAME:Troop565SmithtownNY
> <div id='error'>
> 			<p class='wpdberror'><strong>WordPress database error:</strong>
> [Unknown column &#039;p.post_author&#039; in &#039;on clause&#039;]<br
> />
> 			<code>SELECT
>            p.id as id,
>            post_title,
>            post_excerpt,
>            DATE_FORMAT(post_date_gmt,&#039;%Y%m%dT%H%i%sZ&#039;) as dt_start,
>            user_nicename
>          FROM wp_posts p, wp_post2cat p2c
>          LEFT JOIN wp_users u
>            ON u.ID=p.post_author
>          WHERE post_status = &#039;publish&#039;
>            AND p.id = post_id
>            AND category_id = 2</code></p>
> 			</div>END:VCALENDAR
> --------------------------------------------------------
> 
> Any suggestions on how 2 fix?

I'm pretty sure we've seen this before. I think it's a problem that
happens when you use MySQL 5. Are the two databases running different
versions of MySQL?

The 3.1 equivalent of this code is...

       FROM $wpdb->posts p
       LEFT  JOIN $wpdb->users   u ON p.post_author=u.ID
       INNER JOIN $ec3->schedule s ON p.id=s.post_id

So, try that for me. Replace everything from 'FROM' with...

       FROM $wpdb->posts p,
       LEFT  JOIN $wpdb->users    u   ON p.post_author=u.ID
       INNER JOIN $wpdb->post2cat p2c ON p.id=p2c.post_id
         AND p2c.category_id=$ec3->event_category

Let me know how you get on.

-Alex

-- 
:: Let me solve your problems: http://www.firetree.net/consulting/
:: alex.tingle AT firetree.net  +44-7901-552763 



More information about the EventCalendar mailing list