[drupal-devel] [feature] Multiple simple nodes
Cvbge
drupal-devel at drupal.org
Sat Aug 27 15:03:26 UTC 2005
Issue status update for
http://drupal.org/node/29794
Post a follow up:
http://drupal.org/project/comments/add/29794
Project: Drupal
Version: cvs
Component: node system
Category: feature requests
Priority: normal
Assigned to: chx
Reported by: chx
Updated by: Cvbge
Status: patch (code needs review)
Please change the file name extension, as now it's hard to download.
Maybe we could make type_name longer? 64 or even 128 seems practical
(hell, it's VARCHAR, there should be no difference between 31 and 255).
I've skimmed sql part of module, you do INSERT INTO {node_type}
(type_name, label, description) VALUES ('%s', '%s', '%s'), what about
help column? It's NOT NULL, has no DEFAULT and you don't provide any
value for it.
The SELECT * FROM {node_type} nt WHERE 1 ORDER BY nt.type_name ASC
won't work in postgres, you need to change WHERE 1 to for example WHERE
1=1. Why do you need WHERE anyway?
Cvbge
Previous comments:
------------------------------------------------------------------------
Sat, 27 Aug 2005 11:34:39 +0000 : chx
Attachment: http://drupal.org/files/issues/simplenode.module (9.09 KB)
Instead of page, story etc let's have a module with which you can add
simple body only nodes. At least moshe and I frequently copy
story.module to have a new simple module. For example, event needs
this. For permissions it's great to have multiple node types. So I
downloaded a copy of content.module from CCK, pressed delete a lot,
copied hook_form from story and then rename the stuff to
simplenode.module. Then I reviewed the thing but it was really not
much, so credit goes to JonBob and jvandyk.
MySQL is:
CREATE TABLE node_type (
type_name varchar(31) NOT NULL default '',
label varchar(255) NOT NULL default '',
description mediumtext NOT NULL,
help mediumtext NOT NULL,
PRIMARY KEY (type_name)
) TYPE=MyISAM;
------------------------------------------------------------------------
Sat, 27 Aug 2005 11:44:09 +0000 : chx
Attachment: http://drupal.org/files/issues/simplenode_0.module (8.81 KB)
To save a couple hundred bytes of code and also a lot in DB I removed
hard caching of node types. It's surely needed for CCK, not for us.
------------------------------------------------------------------------
Sat, 27 Aug 2005 13:02:49 +0000 : kbahey
+1.
This is something needed a lot and will save a lot of code duplication,
and tricks like two stub event sumodules.
since CCK will not make it to 4.7, this is the way to go.
More information about the drupal-devel
mailing list