I have installed drupal 6 and Multisite node limit.
In some sections I get the following warning

user warning: Unknown column 'nlr.limit' in 'field list' query: SELECT MAX(nlr.limit) as node_limit, nlr.type as type FROM users as u INNER JOIN users_roles as ur ON (u.uid = ur.uid) INNER JOIN node_limit_role as nlr on (nlr.rid = ur.rid) WHERE u.uid = '22' GROUP BY nlr.type in /var/www/sitios/DRUPAL6/multipro/sites/all/modules/node_limit/node_limit.module on line 379.
user warning: Unknown column 'nlr.limit' in 'field list' query: SELECT nlr.limit as node_limit, nlr.type as type FROM node_limit_role as nlr WHERE nlr.rid = '2' in /var/www/sitios/DRUPAL6/multipro/sites/all/modules/node_limit/node_limit.module on line 388.
user warning: Table 'dbdesa_cotizart.node_limit_user' doesn't exist query: SELECT `limit` as node_limit, `type` FROM node_limit_user WHERE uid = '22' in /var/www/sitios/DRUPAL6/multipro/sites/all/modules/node_limit/node_limit.module on line 396.

Any idea how to solve this problem

Excuse my English

Comments

doknet’s picture

Version: 6.x-1.x-dev » 6.x-0.3

I'm using the version is 6.x-0.3

davedelong’s picture

Version: 6.x-0.3 » 6.x-1.x-dev

Are you using the latest dev version? I don't see those queries in the version I have...

Dave

doknet’s picture

I have a different behavior on the test server I get no error but lead to the production server is the warning
I have installed the latest version

Now check the database if there are any problems to the exporter.

Thank you very much for your help.

doknet’s picture

Uninstall node_limit, truncate cache table, again
installing the latest dev version.
Now I get the following error when trying to create
a limit , result error
user warning: Column count doesn't match value count at row 1 query: INSERT INTO node_limit VALUES('1', '5', 'Obras ', '0') in /var/www/sitios/DRUPAL6/multipro/sites/all/modules/node_limit/node_limit.module on line 521.

gionnibgud’s picture

I had the same problem as doknet with the latest dev.
I tracked down the probleme to the node_limit.install

/**
 * Implementation of hook_schema().
 */
function node_limit_schema() {
  $schema['node_limit'] = array(
    'description' => t('The base Node Limit table'),
    'fields' => array(
      'lid' => array(
        'description' => t('The limit id'),
        'type' => 'int',
        'not null' => TRUE
      ),
      'type' => array( /////// THIS IS THE DB COLUMN THAT GENERATES THE ERROR <-------
        'description' => t('The {node}.type to which this limit applies'),
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => ''
      ),
      'limit' => array(
        'description' => t('The node limit for this limit'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => NODE_LIMIT_NO_LIMIT
      ),
      'title' => array(
        'description' => t('The display name for this limit'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => ''
      ),
      'weight' => array(
        'description' => t('The weight of this limit'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0
      ),
    ),
    'primary key' => array('lid')
  );
  return $schema;
}

function node_limit_update_6001() { //IN FACT I CAN GUESS THAT THE COLUMN SHOUD NOT BE THERE :)      <-------
  if (!module_exists('node_limit_type')) {
    $ret = array();
    drupal_set_message(t('node_limit module cannot be updated until after node_limit_type has been enabled. Please enable node_limit_type and then return to <a href="@update-php">update.php</a> and run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
    $ret['#abort'] = array('success' => FALSE, 'query' => t('node_limit.module has updates, but cannot be updated until after node_limit_type.module is enabled.'));
    
    return $ret;
  }
  db_query("INSERT INTO {node_limit_type} (SELECT lid, type FROM {node_limit})");
  $ret = update_sql("ALTER TABLE {node_limit} DROP COLUMN `type`");
  return $ret;
}

Manually removing the 'type' column from the node_limit table should fixed the issue.
cheers

doknet’s picture

Try now. thanks
But I think that uninstalling and reinstalling join problems.

Thank you very much

doknet’s picture

followed step by step what you said ... .
But when I switch limit 1 to the content, tells me when trying to upload the first node
You can not create more content of type Cotización

And when I raise the limit to 2 gives me the first node upload
this error
page blank and

stdClass Object ( [nid] => [vid] => [uid] => 27 [created] => 1242152979 [type] => firma_digital [language] => es [changed] => [title] => ant [name] => artista [date] => [status] => 1 [promote] => [sticky] => [op] => Guardar [submit] => Guardar [preview] => Previsualizar [form_build_id] => form-d67f0001b3e662a6909672e56fb5cc6c [form_token] => b3c2933979f74de614c548de81b4912e [form_id] => firma_digital_node_form [comment] => 0 [menu] => Array ( [mlid] => 0 [module] => menu [hidden] => 0 [has_children] => 0 [customized] => 0 [options] => Array ( ) [expanded] => 0 [parent_depth_limit] => 8 [link_title] => [parent] => primary-links:0 [weight] => 0 ) [path] => [field_foto_firmaartista] => Array ( [0] => Array ( [fid] => 124 [list] => 1 [data] => Array ( [description] => [alt] => [title] => ) [alt] => [title] => [UPLOAD_IDENTIFIER] => 1ad72fa8dfd72a4ca45d50174c2a2d1f [uid] => 27 [filename] => pain128.jpg [filepath] => sites/cotizartconf/files/pain128.jpg [filemime] => image/jpeg [filesize] => 4094 [status] => 0 [timestamp] => 1242152984 [filefield_upload] => Upload [filefield_remove] => Eliminar [upload] => ) ) )

any idea

sorry my inglis..
Thank

davedelong’s picture

Re #7: That's a duplicate of #451644: can't create or edit content. As for the column issue, I'm learning how the schema hooks work, and it would seem that my first impressions weren't correct.

I'll try and get a new version up soon. (I'm rather busy w/ school and a full-time job)

Dave

doknet’s picture

Ok, thank you very much for your effort,

I hope to contribute at least as tester

adshill’s picture

#4 Happens on fresh install making it impossible to add any content, thus making this module unusable... happens in both release and dev.

I would suggest warning people so that they don't bother downloading till its fixed... Thanks for the hard work and sorry this doesn't work - it was just what I needed otherwise and doesn't appear to be an alternative!

Adam

adshill’s picture

Component: Miscellaneous » Code
Priority: Normal » Critical

suggest this is moved to critical...

vitis’s picture

same problem:

warning:

user warning: Column count doesn't match value count at row 1 query: INSERT INTO node_limit VALUES('1', '1', '1 Listing per member', '0') in (my directory)\sites\all\modules\node_limit\node_limit.module on line 521.

below:

Array ( [lid] => 1 [limit] => 1 [title] => 1 Listing per member [weight] => [node_limit_role] => 5 [node_limit_type] => my_listing ) 
my_listing 
Saved limit "1 Listing per member" 

no node limits found in "List"

I have Node Limit 6.x-1.x-dev (2009-Apr-29), just installed and started to configure on localhost wamp

Is there a working version?
Vitis

dobe’s picture

I have looked into this issue a little bit. It seems it has to do with the node_type limit. The module has the node-type data but is not able to submit it into the database because the insert query on the node_limit module is incomplete. I have seemed to found the reason why this is taking place.

What I did:

Edited node_limit.module,

On line 521 of node_limit.module I replaced
db_query("INSERT INTO {node_limit} VALUES('%d', '%d', '%s', '%d')", $limit['lid'], $limit['limit'], $limit['title'], $limit['weight']);
with
db_query("INSERT INTO {node_limit} VALUES('%d', '%s', '%d', '%s', '%d')", $limit['lid'], $limit['type'], $limit['limit'], $limit['title'], $limit['weight']);

vitis’s picture

Thanks for the update.
Has this change been included in the latest dev?

dobe’s picture

It seems that there is something else causing issues as #13's update makes a dev screen of death when you try to create a node of any type.

duaelfr’s picture

Status: Active » Closed (duplicate)

Seems to be a duplicate of #468266: Mismatched fields, values
(Cleaning the issues list)