Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Database Error in rc9.9216

UserPost

11:23 am
February 25, 2009


metal450

Member

posts 159

1

I just upgraded from rc9.9209 to rc9.9216, and now whenever i post a comment while NOT logged in, I get the following errors.  Comments post fine while logged in as myself.


WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN wp_term_relationships AS tr ON wp_posts.ID = tr.object_id WHERE 1=1 ' at line 1]
LEFT JOIN wp_term_relationships AS tr ON wp_posts.ID = tr.object_id WHERE 1=1 AND ( ( post_status = 'publish' AND ( ( ( ( ( ( 1=1 AND ID NOT IN ('18', '30', '33', '36', '41', '43', '47', '50', '56', '61', '66', '76', '101', '102', '117', '124', '127', '128', '148', '149', '217', '226', '228', '229', '232', '234', '249', '253', '259', '263', '266', '267', '270', '277', '279', '286', '299', '302', '305', '308', '310', '311', '320', '329', '333', '335', '338', '349', '356', '359', '362', '364', '371', '373', '377', '381', '390', '397', '408', '409', '410', '414', '424', '452', '456', '484', '951', '1018', '1240', '1285', '1384', '1427', '1445', '1479', '1545', '1581', '1607', '1678', '1684', '1697', '1699', '1732', '1788', '1832', '1884', '1899', '1932', '2171', '2181', '2239', '2442', '2567', '2716', '2844', '2910', '2958', '2982', '3045', '3082') ) ) ) ) ) ) ) )

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN wp_term_relationships AS tr ON wp_posts.ID = tr.object_id WHERE 1=1 ' at line 1]
LEFT JOIN wp_term_relationships AS tr ON wp_posts.ID = tr.object_id WHERE 1=1 AND ( ( post_status = 'publish' AND ( ( ( ( ( ( 1=1 AND ID NOT IN ('18', '30', '33', '36', '41', '43', '47', '50', '56', '61', '66', '76', '101', '102', '117', '124', '127', '128', '148', '149', '217', '226', '228', '229', '232', '234', '249', '253', '259', '263', '266', '267', '270', '277', '279', '286', '299', '302', '305', '308', '310', '311', '320', '329', '333', '335', '338', '349', '356', '359', '362', '364', '371', '373', '377', '381', '390', '397', '408', '409', '410', '414', '424', '452', '456', '484', '951', '1018', '1240', '1285', '1384', '1427', '1445', '1479', '1545', '1581', '1607', '1678', '1684', '1697', '1699', '1732', '1788', '1832', '1884', '1899', '1932', '2171', '2181', '2239', '2442', '2567', '2716', '2844', '2910', '2958', '2982', '3045', '3082') ) ) ) ) ) ) ) )

Warning: Cannot modify header information - headers already sent by (output started at /home/metal450/public_html/wordpress/wp-includes/wp-db.php:517) in /home/metal450/public_html/wordpress/wp-comments-post.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/metal450/public_html/wordpress/wp-includes/wp-db.php:517) in /home/metal450/public_html/wordpress/wp-comments-post.php on line 80

Warning: Cannot modify header information - headers already sent by (output started at /home/metal450/public_html/wordpress/wp-includes/wp-db.php:517) in /home/metal450/public_html/wordpress/wp-comments-post.php on line 81

Warning: Cannot modify header information - headers already sent by (output started at /home/metal450/public_html/wordpress/wp-includes/wp-db.php:517) in /home/metal450/public_html/wordpress/wp-includes/pluggable.php on line 850

11:54 am
February 25, 2009


Kevin

Admin

posts 2402

2

Are those excerpts you posted the entire query which was reported?

Do you have any custom code in your comment template?

Can you remind me what your teaser settings are, and whether you have set any other non-default options?

What WP version are you on?

12:04 pm
February 25, 2009


metal450

Member

posts 159

3

That is the full content of the page I see after submitting a comment.


The comment template is very customized; if it's relevant, i'm happy to email it to you.


Teaser settings are: "Enable teaser for posts, pages" + both "Hide private Posts (instead of teasing)" and "Hide private Pages (instead of teasing)" are UNCHECKED.   Inside single.php, I have code like:

if( function_exists('is_teaser_rs') && is_teaser_rs() )

{

…show a custom page, sending a 404 error…

}


I was on WP2.7, and am right in the midst of upgrading to 2.7.1

12:12 pm
February 25, 2009


Kevin

Admin

posts 2402

4

Okay, and I just remembered that your comments are on attachments. I suspect that's the key condition and I should have a fix for your shortly.

12:13 pm
February 25, 2009


metal450

Member

posts 159

5

The above bug was observed for comments on regular posts

12:17 pm
February 25, 2009


Kevin

Admin

posts 2402

6

metal450 said:

The above bug was observed for comments on regular posts


…unreadable posts for which the teaser is being applied?

12:17 pm
February 25, 2009


metal450

Member

posts 159

7

Problem still present after upgrading to WP 2.7.1

12:37 pm
February 25, 2009


Kevin

Admin

posts 2402

8

I confirmed the error for attachments and teased posts. The following change in function flt_recent_comments of role-scoper/hardway/hardway_rs.php should fix it.

change:

if ( ! is_attachment() && ! is_administrator_rs() ) {

to:

if ( empty($_POST) && ! is_attachment() && ! is_administrator_rs() ) {

I'll include that in the next RS version.

12:41 pm
February 25, 2009


metal450

Member

posts 159

9

That got it!  Thanx :)

12:54 pm
February 25, 2009


Kevin

Admin

posts 2402

10

Good, but I realized this would be a better fix, allowing the Recent Comments filter to still work for display purposes following a comment posting:

change:

&& strpos($query, "ELECT") && ! strpos($query, 'JOIN') && ! strpos($query, "COUNT") )

to:

&& strpos($query, "ELECT") && ! strpos($query, 'JOIN') && ! strpos($query, "COUNT") && strpos($query, "comment_approved") )

12:59 pm
February 25, 2009


metal450

Member

posts 159

11

Eh…I've got a bunch of code all torn apart at the moment (different project), so as long as everything is safely working, I'll just grab the next development snapshot from ye :)


About the Agapetry forum

Currently Online:

16 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1186

Posts: 5409

Members:

There are 1176 members

There are 1 guests


Kevin has made 2402 posts

Top Posters:

metal450 - 159

Ragnar - 105

YikYak - 70

whiteorb - 44

Daisy - 35

Administrator: Kevin | Moderators: Kevin