Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#283 closed enhancement (fixed)

Database Error on "Manage" -> Pages

Reported by: anonymousbugger's profile anonymousbugger Owned by: ryan's profile ryan
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:

Description

Warning: join(): Bad arguments. in /usr/www/users/dario77/grassegger.at/wp1.3/wp-admin/edit.php on line 13

I just installed the lastest build: wordpress-2004-09-14.zip then clicked on "Manage" and then of "Pages" and the error get displayed.

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 ')' at line 1]
SELECT ID, post_title FROM wp_posts WHERE post_status = 'draft' AND post_author IN ()

Change History (8)

#2 @anonymousbugger
19 years ago

you can see same error in "Posts" in Admin area.

#3 @ryoken
19 years ago

error still occurs in same spot on the 9-15 build

#4 @anonymousbugger
19 years ago

According to http://www.php.net/manual/en/function.implode.php line 13 of wp-admin/edit.php is using wrong syntax of join() (alias of implode())

so it should be

$editable = join(',', $editable);

instead of

$editable = join($editable, ',');

#5 @timeistight
19 years ago

That doesn't fix the error, though.

#6 @bronski
19 years ago

i think this only happens when you have only one user.

well, in edit.php in line 12 there is an SQL statement:

$editable = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_level <= '$user_level' AND ID != $user_ID");

so when there is only the admin-user, ID = 1, this select results in an empty query, the array cannot be joined and the known error occurs.

as soon as you add a second user the array contains values and the error is gone.

either the SQL-statement is not as intended by the author or an additional check for this case is missing.

edited on: 09-15-04 17:55

#7 @ryan
19 years ago

  • Owner changed from anonymous to rboren
  • Resolution changed from 10 to 20
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.