WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8 closed defect (bug) (invalid)

SQL error when editing link in Manage Links

Reported by: anonymousbugger Owned by: JasonV
Milestone: Priority: normal
Severity: critical Version:
Component: General Keywords:
Focuses: Cc:

Description

Edit link form without data appears with the following is the error message above it:

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 3]
SELECT * FROM wp_links WHERE link_id =

Change History (13)

comment:2 matt10 years ago

  • Severity changed from enhancement to critical

comment:3 JasonV10 years ago

So you clicked on an 'edit' button and got this error? I can only reproduce this if I modify the query by getting rid of 'link_id'.

comment:4 JasonV10 years ago

  • Status changed from new to assigned

comment:5 JasonV10 years ago

  • reproducibility changed from 10 to 90

comment:6 JasonV10 years ago

  • Owner changed from anonymous to JasonV

comment:7 JasonV10 years ago

  • reproducibility changed from 90 to 30
  • Resolution changed from 10 to 20
  • Status changed from assigned to closed

Found the problem. The link ID was not being passed correctly for systems without register globals turned on. Just added this line: $link_id = $_GETlink_id?;

comment:8 anonymousbugger10 years ago

  • Resolution changed from 20 to 30
  • Status changed from closed to assigned

$link_id = $_GETlink_id?;
is incorrrect

$link_id = $_GETlink-id?;
works if placed before line 310 in link-manager.php (note the
hyphen instead of the underscore

comment:9 JasonV10 years ago

$_GETlink-id???? I must be missing something... I can't see how that would help, the query uses "link_id".

Are you using 1.2 or a nightly?

comment:10 anonymousbugger10 years ago

Ah you know what it is? It's a bug in a plugin that rewrites WP URLs to move from underscores to hyphens. The correct URL (in the CMS) has link_id, but the plugin rewrites it to link-id.

http://idly.org/2004/05/13/fixing-mt-urls-for-wp

comment:11 Anne10 years ago

So this bug is invalid, right?

comment:12 JasonV10 years ago

  • Resolution changed from 30 to 70
  • Status changed from assigned to closed

I would say so. I'm going to back out the 'fix' I made, because $link_id is set earlier in the code anyway.

Note: See TracTickets for help on using tickets.