The SQL produced by the quotes_install function has the first line:

"CREATE TABLE {quotes}..."

when it should be:

"CREATE TABLE 'drupalDbName.quotes'..."

where drupalDbName is the name of the database of the Drupal installation.

So this seems to be a parsing problem, except that oddly, the 'quotes_blocks' table is being created OK.

Comments

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

The curly brackets are supposed to tell the database layer to insert the Drupal database name and prefix. Was there some other error message? Also, please select the correct release number so I look at the correct branch of the code.

nicks’s picture

The SQL for building the quotes table is invalid because the keyword "UNSIGNED" is in the wrong place.

The included code is:

db_query('CREATE TABLE {quotes} (
          nid INTEGER NOT NULL UNSIGNED,
          vid INTEGER NOT NULL PRIMARY KEY UNSIGNED,
          author VARCHAR(255) NOT NULL,
          citation VARCHAR(255),
          promote INTEGER UNSIGNED NOT NULL DEFAULT 0
        ) /*!40100 DEFAULT CHARACTER SET utf8 */');

It should be:

db_query('CREATE TABLE {quotes} (
          nid INTEGER UNSIGNED NOT NULL,
          vid INTEGER UNSIGNED NOT NULL PRIMARY KEY,
          author VARCHAR(255) NOT NULL,
          citation VARCHAR(255),
          promote INTEGER UNSIGNED NOT NULL DEFAULT 0
        ) /*!40100 DEFAULT CHARACTER SET utf8 */');

Thanks for the module!

Nick

nancydru’s picture

Assigned: Unassigned » nancydru
Status: Postponed (maintainer needs more info) » Fixed

Fix committed to -dev version.

vkams’s picture

Thank you for explanation! I had made even more changes: in quotes.install file the SQL-command looks
db_query('CREATE TABLE quotes (
nid INTEGER UNSIGNED NOT NULL,
vid INTEGER UNSIGNED NOT NULL PRIMARY KEY,
author VARCHAR(255) NOT NULL,
citation VARCHAR(255),
promote INTEGER UNSIGNED NOT NULL DEFAULT 0
)
(i.e. simply word quotes without {})

Now it works!

nancydru’s picture

That doesn't make sense. The curly brackets tells Drupal to add the DB prefix if there is one. Removing them should NOT work.

nancydru’s picture

Status: Fixed » Closed (fixed)