#283 closed enhancement (fixed)
Database Error on "Manage" -> Pages
Reported by: | anonymousbugger | Owned by: | 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)
#4
@
20 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, ',');
#6
@
20 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
you can see same error in "Posts" in Admin area.