I tried installing the Drupal 6 Knurl tar file. Under RC2, I got the following error when I enabled the module:

user warning: Incorrect table definition; there can be only one auto column and it must be defined as a key query: CREATE TABLE knurl ( `tid` INT unsigned NOT NULL auto_increment, `uid` INT unsigned NOT NULL DEFAULT 0, `short_url` VARCHAR(255) NOT NULL DEFAULT '', `link` TEXT NOT NULL DEFAULT '' ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in C:\Program Files\XAMPP\xampp\htdocs\drupal6rc2\includes\database.inc on line 498.

I added a primary key to the knurl table schema, which seemed to fix that.

I also noticed that the javascript/bookmarklet for adding a link didn't contain the subdirectory where I have Drupal installed. Adding a call to base_path() got that added. Unfortunately, the bookmarklet still isn't working (the link doesn't appear to be getting passed in correctly). I suspect that may be related to the form_token not being passed in, when the URL is coming in from outside the form.

Comments

matt v.’s picture

By the way, thanks for creating the module.

I'm interested in possibly adapting it to act as a YubNub clone.

korayal’s picture

you forgot to change the file location in patch file.

korayal’s picture

StatusFileSize
new4.26 KB
new395 bytes

fixed the location, fixed the favorite shortcut problem.

korayal’s picture

also it's better to look for referer with referer_uri() function than $_GET["url"]

check;

http://www.hecatomber.org/knurl?url=http://www.google.com.tr/search?hl=t...

i changed my module like this;

$_GET['url'] = referer_uri();

and the shortcut;

javascript:void(location.href='http://www.hecatomber.org/knurl?url=')

So, i don't even need to specify an url because that's what referer_uri() command does. But this time it doesn't work on manual entries.

this should do it;

$_GET['url'] = referer_uri();
if (strpos($_GET['url'], _get_server_url() . base_path()) !== false){
  $_GET['url'] = "";
}
christefano’s picture

Priority: Normal » Critical
StatusFileSize
new375 bytes

The patch for the .install file doesn't apply so I rerolled it. Leaving this as "needs review" so that we can get the .install file fixed.

I haven't tried the patch for the bookmarklet. Can someone create a new issue for that?

cfuller12’s picture

Status: Needs review » Fixed

The install file has been updated and no longer throws errors in the latest release. I don't like the use of $_GET['url'] either so I'll create a separate issue for that.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.