Forums

Help with hopefuly trivial sql error in gengo (2 posts)

  1. dragoman
    Member
    Posted 4 years ago #

    I am using gengo 9 beta 4 with a static front page and when posting a comment I get the following error:

    ]: Bad arguments. in /public_html/wp-content/plugins/gengo/gengo.php on line 1116

    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 ') AND p2l1.post_id = 8 AND p2l1.translation_group != 0' at line 1]
    SELECT p2l2.post_id, p2l2.language_id FROM wp_post2lang AS p2l1 INNER JOIN wp_post2lang AS p2l2 ON (p2l1.translation_group = p2l2.translation_group) WHERE p2l2.language_id IN () AND p2l1.post_id = 8 AND p2l1.translation_group != 0

    My php knowledge is almost non existent, so I am unable to catch the error, but I pasted the code from line 1116 below, hoping it is a trivial error, and someone would notice it, and help me clean it up.

    $language_ids = implode(",", $ids);
    			if ($pages = $wpdb->get_results("SELECT p2l2.post_id, p2l2.language_id FROM $this->post2lang_table AS p2l1 INNER JOIN $this->post2lang_table AS p2l2 ON (p2l1.translation_group = p2l2.translation_group) WHERE p2l2.language_id IN ($language_ids) AND p2l1.post_id = $page_on_front AND p2l1.translation_group != 0")) {
    				foreach ($ids as $id) {
    					foreach ($pages as $page) {
    						if ($id == $page->language_id) {
    							$this->page_on_front = $page->post_id;
    							return $this->page_on_front;
    						}

    Thanks a lot.

  2. dragoman
    Member
    Posted 4 years ago #

    Installing SpamKarma seems to have solved the issue.

Topic Closed

This topic has been closed to new replies.

About this Topic