Download & Extend

Table nodewords_custom doesn't exist

Project:Nodewords: D6 Meta Tags
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

user warning: Table 'example.nodewords_custom' doesn't exist query: SELECT * FROM nodewords_custom ORDER BY weight ASC in /home/example/public_html/drupal/sites/default/modules/nodewords/nodewords.module on line 1257.

Comments

#1

this was a fresh install of nodewords - no previous version of nodewords was installed

#2

The table nodewords_custom is created by the installation function.

<?php
/**
* Implementation of hook_schema().
*/
function nodewords_schema() {
 
$schema['nodewords'] = array(
   
'description' => 'The table containing the meta tag values for all the pages.',
   
'fields' => array(
     
'mtid' => array(
       
'description' => 'The primary key.',
       
'type' => 'serial',
       
'not null' => TRUE,
      ),
     
'type' => array(
       
'description' => 'The type of object to which the meta tag refers (node, user, page, etc...).',
       
'type' => 'varchar',
       
'length' => 16,
       
'not null' => TRUE,
       
'default' => '',
      ),
     
'id' => array(
       
'description' => 'The object ID.',
       
'type' => 'varchar',
       
'length' => 255,
       
'not null' => TRUE,
       
'default' => '',
      ),
     
'name' => array(
       
'description' => 'The meta tag name.',
       
'type' => 'varchar',
       
'length' => 32,
       
'not null' => TRUE,
       
'default' => '',
      ),
     
'content' => array(
       
'description' => 'The content of the meta tag.',
       
'type' => 'text',
       
'size' => 'big',
       
'not null' => TRUE,
      ),
    ),
   
'indexes' => array(
     
'nodewords_id' => array(array('id', 6)),
     
'nodewords_type' => array(array('type', 6)),
    ),
   
'unique keys' => array(
     
'tin' => array('type', 'id', 'name'),
    ),
   
'primary key' => array('mtid'),
  );

 
$schema['nodewords_custom'] = array(
   
'description' => 'The table containing data for custom pages.',
   
'fields' => array(
     
'pid' => array(
       
'description' => 'The primary key.',
       
'type' => 'serial',
       
'not null' => TRUE,
      ),
     
'path' => array(
       
'description' => 'The page path.',
       
'type' => 'varchar',
       
'length' => 255,
       
'not null' => TRUE,
       
'default' => '',
      ),
     
'weight' => array(
       
'description' => 'The weight of the page.',
       
'type' => 'int',
       
'size' => 'tiny',
       
'not null' => TRUE,
       
'default' => 0,
      ),
     
'enabled' => array(
       
'description' => 'A flag set when the page is enabled.',
       
'type' => 'int',
       
'size' => 'tiny',
       
'not null' => TRUE,
       
'default' => 1,
      ),
    ),
   
'unique keys' => array(
     
'path' => array('path'),
    ),
   
'primary key' => array('pid'),
  );

  return
$schema;
}

/**
* Implementation of hook_install().
*/
function nodewords_install() {
 
drupal_install_schema('nodewords');
 
db_query("UPDATE {system} SET weight = 10 WHERE name = 'nodewords' AND type = 'module'");
}
?>

#3

Title:nodewords_custom table doesn't exist» Table nodewords_custom doesn't exist

I cannot reproduce this; I installed version 6.x-1.0-beta5 from zero, but I don't get any error about a not existing table.

As shown from the screenshot, I was able to save the meta tags for two different custom page, which would not be possible if the table was not created.

AttachmentSizeStatusTest resultOperations
Voila_Capture_51.png46.49 KBIgnored: Check issue status.NoneNone

#4

Status:active» postponed (maintainer needs more info)

#5

Category:bug report» support request
Status:postponed (maintainer needs more info)» fixed

#6

I had this problem too with a fresh install of nodewords6.x-1.3-beta5. I ran update.php and it updated nodewords to nodewords6100 and seemed to add the table along with a long list of db updates. (included below)

The following queries were executed
nodewords module
Update #6100

    * ALTER TABLE {nodewords} CHANGE content `content` LONGTEXT NOT NULL
    * CREATE NEW SETTING VARIABLES

Update #6102

    * INSERT INTO {nodewords} (type, id, name, content) VALUES ('default', '', 'copyright', '')
    * INSERT INTO {nodewords} (type, id, name, content) VALUES ('default', '', 'geourl', '0,0')
    * INSERT INTO {nodewords} (type, id, name, content) VALUES ('default', '', 'keywords', '')
    * INSERT INTO {nodewords} (type, id, name, content) VALUES ('default', '', 'robots', '')

Update #6103

    * UPDATE {nodewords} SET name = 'revisit-after' WHERE name = 'Revisit-After'
    * UPDATE {nodewords} SET name = 'dc.title' WHERE name = 'DC.Title'
    * UPDATE {nodewords} SET type = 'frontpage' WHERE type = 'page' AND id = ''

Update #6104

    * UPDATE MODULE SETTINGS

Update #6106

    * UPDATE {nodewords} SET name = 'location' WHERE name = 'geourl'

Update #6113

    * CREATE TABLE {nodewords_tmp} ( `mtid` INT NOT NULL auto_increment, `type` VARCHAR(16) NOT NULL DEFAULT '', `id` VARCHAR(255) NOT NULL DEFAULT '', `name` VARCHAR(32) NOT NULL DEFAULT '', `content` LONGTEXT NOT NULL, PRIMARY KEY (mtid), UNIQUE KEY tin (type, id, name), INDEX nodewords_id (id(6)), INDEX nodewords_type (type(6)) ) /*!40100 DEFAULT CHARACTER SET UTF8 */
    * DROP TABLE {nodewords}
    * ALTER TABLE {nodewords_tmp} RENAME TO {nodewords}

Update #6115

    * CREATE TABLE {nodewords_custom} ( `pid` INT NOT NULL auto_increment, `path` VARCHAR(255) NOT NULL DEFAULT '', `weight` TINYINT NOT NULL DEFAULT 0, `enabled` TINYINT NOT NULL DEFAULT 1, PRIMARY KEY (pid), UNIQUE KEY path (path) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Update #6117

    * DELETE FROM {nodewords} WHERE type IN ('views', 'panels')

Update #6120

    * ALTER TABLE {nodewords} DROP KEY tin
    * ALTER TABLE {nodewords} CHANGE type `type` VARCHAR(16) NOT NULL DEFAULT ''
    * ALTER TABLE {nodewords} CHANGE id `id` VARCHAR(255) NOT NULL DEFAULT ''
    * ALTER TABLE {nodewords} CHANGE name `name` VARCHAR(32) NOT NULL DEFAULT ''
    * ALTER TABLE {nodewords} ADD UNIQUE KEY tin (type, id, name)
    * ALTER TABLE {nodewords_custom} DROP KEY path
    * ALTER TABLE {nodewords_custom} CHANGE path `path` VARCHAR(255) NOT NULL DEFAULT ''
    * ALTER TABLE {nodewords_custom} ADD UNIQUE KEY path (path)
    * ALTER TABLE {nodewords_custom} CHANGE weight `weight` TINYINT NOT NULL DEFAULT 0

Update #6122

    * UPDATE {nodewords_custom} SET weight = 10 WHERE weight > 10
    * UPDATE {nodewords_custom} SET weight = -10 WHERE weight < -10

Update #6128

    * DELETE FROM {nodewords} WHERE type = 'offline'

Update #6131

    * DELETE FROM {variable} WHERE name LIKE 'nodewords-%'

Update #6135

    * No queries

Update #6136

    * UPDATE {system} SET status = 1 WHERE type = 'module' AND name = 'nodewords_basic'
    * UPDATE {system} SET status = 1 WHERE type = 'module' AND name = 'nodewords_extra'

Update #6137

    * No queries

Update #6139

    * No queries

Update #6140

    * No queries

Update #6141

    * No queries

Update #6143

    * No queries

Update #6144

    * UPDATE MENUS

#7

I had this problem too with a fresh install of nodewords6.x-1.3-beta5.

When you install a module, the update functions are not invoked; update functions are invoked when you pass from an older version to a newer version.
I don't understand what you mean by install of nodewords6.x-1.3-beta5, in that case.

#8

I had the problem as well after installing the OpenPublish 1.5.1- Build 309 which contains the 6.x-1.0 release of nodewords and then upgrading tot he 6.x-1.3-beta5 release. I updated via running "drush updatedb" which completed with some errors for other modules.

Because this was a brand new site I solved the problem by doing an "uninstall" on nodewords and then re-enabling the module.

#9

@greggles: Did you notice any error messages while updating to 6.x-1.3-beta5?
The update function #6115 creates the table; I don't understand how the table could not be created, if the code to create it is executed.

#10

I did see some error messages, but they didn't seem related to nodewords.

#11

I checked what is different between version 6.x-1.0, and 6.x-1.3-beta5.
Version 6.x-1.0 doesn't define any update functions; therefore, all the update functions that are available in version 6.x-1.3-beta5 should be invoked. I cannot explain why the database table is not created, and why Drupal would not report any errors for the SQL query that creates the database table.

I will simplify the update function #6115, which was created for updating between different releases of the development snapshot.

#12

Recent commits added a new update function that checks if the table nodewords_custom exists, and creates it in the case it doesn't exist.

If even with the new update function the table is not created, then I don't know what else I should do (expect that hope nobody reports that even the new update doesn't create the table :-)).

#13

Status:fixed» closed (fixed)

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

#14

Status:closed (fixed)» active

im getting the same problem, .. and its been doing this to all my other sites, i kept trying (uninstalling, deleting the whole thing from the server then putting it back in, reinstalling) it finally worked on one of my sites,. that was last year though

i have a new site now and nodewords still displays the same error msg its been displaying before. nodewords_custom doesn't exist, the error was something like this:

dbdrupal.nodewords_custom' doesn't exist query: SELECT * FROM nodewords_custom ORDER BY weight ASC in

#15

Status:active» postponed (maintainer needs more info)

I need more information to understand why the code that creates the table is not creating it, as I have never had this problem.

If you install the module, then the table is created from the installation function, and that code is always executed when installing a new module.
Did you try uninstalling the module through the modules page, removing any reference to the project modules in the database, and then re-installing it?
In the case you updated the project modules, did you run update.php?
Finally, which version are you using?

#16

I am having the same error. I have uninstalled and installed again with the same results.

I am using version 6.x-1.x-dev because the site page said:

version 6.x-1.10, and later versions, have been created as official releases to make them visible on the front page, but it should be considered beta versions. Do not update to such versions, if not to help in the development of the module.

Note: this was not an upgrade, but a new installation

#17

Status:postponed (maintainer needs more info)» active

Ran into this same issue today. Try installing a fresh copy of the 6.x-1.x-dev branch and enabling everything except "Extra meta tags". You start getting this error:

user warning: Table 'exampledb.nodewords_custom' doesn't exist query: SELECT * FROM nodewords_custom ORDER BY weight ASC in /exampledir/sites/all/modules/nodewords/nodewords.module on line 1400.

Mind taking a closer look at it? :)

Thanks,

- Kyle Oliveira

#18

Version:6.x-1.3-beta5» 6.x-1.x-dev
Category:support request» bug report
Priority:normal» critical
Status:active» needs review

I confirm this bug. It raises after installation of nodewords module. I don't understand what has happend in revision 1.10.2.173? The whole block of code, which is responsible for creating {nodewords_custom} table was deleted from nodewords_schema() function. Look at http://drupalcode.org/viewvc/drupal/contributions/modules/nodewords/node... I am attaching the patch.

AttachmentSizeStatusTest resultOperations
nodewords_custom.patch1.52 KBIgnored: Check issue status.NoneNone

#19

I have marked #734194: Table nodewords_custom not defined in schema as duplicate of this report.

#20

Status:needs review» reviewed & tested by the community

The patch worked for me too. Can we just commit it?

#21

I have marked #737986: Cannot create new Custom Page as duplicate of this report.

#22

How do I apply this patch on an ISP hosted server where I don't have access to a command line?

#23

Status:reviewed & tested by the community» fixed

The code to handle the database table has been moved to a new module, which creates the table when it's initially enabled from nodewords.module.

As usual, read what reported in the project page, before to update the installed modules.

#24

Status:fixed» closed (fixed)

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

#25

Ran into this as well, database update solved my issue.

#26

Priority:critical» minor

Same here. ".nodewords_custom' doesn't exist query" error upon fresh nodewords install on new site. Running update.php fixed the problem for me - updated the DB tables.

nobody click here