WordPress.org

Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 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)

#2 @matt
15 years ago

  • Severity changed from enhancement to critical

#3 @JasonV
15 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
15 years ago

  • Status changed from new to assigned

#5 @JasonV
15 years ago

  • reproducibility changed from 10 to 90

#6 @JasonV
15 years ago

  • Owner changed from anonymous to JasonV

#7 @JasonV
15 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
15 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
15 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
15 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

#11 @Anne
15 years ago

So this bug is invalid, right?

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