Recent Topics

1 Jun 28, 2005 19:10    

hi everybody

i've just installed the new version 0.9.0.12 on my win 2k box running xampp 3 (apache 2.0.50 (running as service); php v5.0.0; mysql v4.0.20a-nt-log (running as service))

before installation of b2e i've created the database "b2evolution" and a user b2e with full rights on that database (only).
(done that with MyPhpAdmin).

the apache webs are running on port 81 !

I've installed b2e into
/htdocs/blogs/b2e

Well, no errors during installation.
login as admin works fine

but !

I get the following error, if I try to open a blog (admin or anonymous)
(eg: http://localhost:81/blogs/b2e/index.php?blog=2 )

MySQL Fehler!

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 ( ( post_status = 'private' AND post_author = 1 ) OR (Errno=1064)

Your query:
SELECT DISTINCT ID, post_author, post_issue_date, post_mod_date, post_status, post_locale, post_content, post_title, post_urltitle, post_url, post_category, post_autobr, post_flags, post_wordcount, post_comments, post_renderers, post_karma FROM (evo_posts INNER JOIN evo_postcats ON ID = postcat_post_ID) INNER JOIN evo_categories ON postcat_cat_ID = cat_ID WHERE cat_blog_ID = 2
AND postcat_cat_ID IN () AND ( ( post_status = 'private' AND post_author = 1 ) OR post_status IN ('published','protected') ) AND post_issue_date <= '2005-06-28 19:06:40' ORDER BY post_issue_date LIMIT 5

I figured out that the red marked part of the statement causes this error.

but: there is no hint, in which php file ore include this sql statement is generated. :(

where do I find that statement and what do I have to change ?

thanks a lot

cu

alex

2 Jun 28, 2005 19:22

and another error occurs, if I want to edit a blog. see the message below:

MySQL Fehler!

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 ( post_status IN ('') ) ORDER BY post_issue_date LIMI(Errno=1064)

Your query:
SELECT DISTINCT ID, post_author, post_issue_date, post_mod_date, post_status, post_locale, post_content, post_title, post_urltitle, post_url, post_category, post_autobr, post_flags, post_wordcount, post_comments, post_renderers, post_karma FROM (evo_posts INNER JOIN evo_postcats ON ID = postcat_post_ID) INNER JOIN evo_categories ON postcat_cat_ID = cat_ID WHERE cat_blog_ID = 2 AND postcat_cat_ID IN () AND ( post_status IN ('') ) ORDER BY post_issue_date LIMIT 5

3 Jul 09, 2005 04:50

I get a similar error here. It is quite strange. I can read the post just fine, but when I click on the permalink, I get a 1064 error.
This is b2evo 0.9.0.12.

MySQL 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 ''' at line 7(Errno=1064)

Your query:
SELECT DISTINCT ID, post_author, post_issue_date, post_mod_date, post_status, post_locale, post_content, post_title, post_urltitle, post_url, post_category, post_autobr, post_flags, post_wordcount, post_comments, post_renderers, post_karma FROM (evo_posts INNER JOIN evo_postcats ON ID = postcat_post_ID) INNER JOIN evo_categories ON postcat_cat_ID = cat_ID WHERE cat_blog_ID = 6 AND post_urltitle = '

Update: I played a bit with the urltitle, and it seems that the error happens only if there are certain words in the url:
I originally used 'limit_scenarios' as urltitle. That caused problems.
Similar with 'term_limit_scenarios'.
But, using 'term_scenarios' or 'scenarios' as urltitle works.
Is the word "limit" somehow prohibited somewhere?

4 Jul 25, 2005 18:22

I get the same error with any combination containing "limit" in the urltitle.I was trying 'gobierno_limitado' :-(

5 Nov 20, 2005 05:23

I could not reproduce this with either version 0.9.1 nor 1.6 at the demo site (http://demo.b2evolution.net).

Is this fixed since 0.9.1 or before?

I've only tried the limit issue Austriaco and jfeise had.

alexm12, could you figure out what the problem was with your installation?

6 Dec 26, 2005 18:19

blueyed wrote:

I could not reproduce this with either version 0.9.1 nor 1.6 at the demo site (http://demo.b2evolution.net).

Is this fixed since 0.9.1 or before?

I've only tried the limit issue Austriaco and jfeise had.

Sorry, it took me a while to find time, but I can confirm that my problem is fixed with 0.9.1.

7 Mar 27, 2006 16:52

I've found the problem:

 
function calc_max() {
[...]
if( $pos = strpos(strtoupper($this->request), 'LIMIT'))
{ // Remove the limit form the request
    $nxt_request = substr($this->request, 0, $pos);
}
[...]
}

This bug is in file b2evocore/_class_itemlist.php

This is not a good way to calculate the maximum results of a query...

9 May 25, 2006 23:15

I agree - upgrading to Dawn (v0.9.1.0) or Sparkle (v0.9.2.0) is the best move. However, if you you would prefer to solve this bug and upgrade at a later time, then you can replace the offending function with a copy from the Dawn (v0.9.1.0) release.

Replace the entire function in _class_itemlist.php [shown below, from Amsterdam (v0.9.0.12) ]

<?php


	/*
	 * Private ItemList->calc_max(-)
	 *
	 * @todo use COUNT(*)
	 */

	function calc_max()
	{
		global $DB;

		if( $this->preview )
			return 1;	// 1 row in preview mode

		$nxt_request = $this->request;
		if( $pos = strpos(strtoupper($this->request), 'LIMIT'))
		{ // Remove the limit form the request
			$nxt_request = substr($this->request, 0, $pos);
		}
		//echo $nxt_request;

		$DB->query( $nxt_request );
		$this->total_num_posts = $DB->num_rows;
		$this->max_paged = intval( ($this->total_num_posts-1) / max($this->posts_per_page, $this->result_num_rows)) +1;
		if( $this->max_paged < 1 )
			$this->max_paged =1;
	}


?>

With a copy from the following (from the same file in Dawn (v0.9.1.0):

<?php


	/*
	 * Private ItemList->calc_max(-)
	 */
	function calc_max()
	{
		global $DB;

		if( $this->preview )
			return 1;	// 1 row in preview mode

		$this->total_num_posts = $DB->get_var( $this->count_request, 0, 0, 'Get result count' );

		$this->max_paged = intval( ($this->total_num_posts-1) / max($this->posts_per_page, $this->result_num_rows)) + 1;
		if( $this->max_paged < 1 )
			$this->max_paged =1;
	}	


?>

Hope this helps, as I'm in that boat at the moment (want to solve the problem, but not ready to tackle an entire upgrade just to leave the word "limit" in the url_title). ;)


Form is loading...