Make WordPress Core

Opened 20 years ago

Closed 20 years ago

Last modified 21 months ago

#8 closed defect (bug) (invalid)

SQL error when editing link in Manage Links

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


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)

#2 @matt
20 years ago

  • Severity changed from enhancement to critical

#3 @JasonV
20 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'.

#4 @JasonV
20 years ago

  • Status changed from new to assigned

#5 @JasonV
20 years ago

  • reproducibility changed from 10 to 90

#6 @JasonV
20 years ago

  • Owner changed from anonymous to JasonV

#7 @JasonV
20 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?;

#8 @anonymousbugger
20 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

#9 @JasonV
20 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?

#10 @anonymousbugger
20 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.

#11 @Anne
20 years ago

So this bug is invalid, right?

#12 @JasonV
20 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.