[drupal-devel] [bug] welcome text appears when the query in node_page_default is rewritten to have an empty result

chx drupal-devel at drupal.org
Sat Mar 5 20:19:38 UTC 2005


Issue status update for http://drupal.org/node/18340

 Project:      Drupal
 Version:      cvs
 Component:    node.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  chx
 Reported by:  chx
 Updated by:   chx
 Status:       patch
 Attachment:   http://drupal.org/files/issues/node0_0.patch (7.16 KB)

totally broken patch :(


chx



Previous comments:
------------------------------------------------------------------------

March 4, 2005 - 00:22 : chx

Attachment: http://drupal.org/files/issues/default_as_node.patch (8.55 KB)

As discussed on IRC, I have moved the welcome text into node 0 as a PHP
node. Although there is a check for whether this welcome node is
present for every node_page_default call, it is only a variable_get, so
it is cheap. Also at every node save we check for the same variable, and
if the welcome node is present, it gets silently deleted. So, as soon as
the first node gets created, the welcome text disappears as it should.
The one liner in node_validate is very important when a node with nid=0
is present. Otherwise, consider it a minor speedup.
This patch should have a little positive effect on the memory
requirements of node.module -- a long, rarely used text is removed.
This is not a new feature but a usability issue so let's get it into
4.6. Although there is change (two INSERTs) to database.mysql and
database.pgsql it does not mandate an update.inc change 'cos most
probably noone will bother with updating an empty site.
I payed special attention to spaces this time.


------------------------------------------------------------------------

March 4, 2005 - 01:10 : chx

We discussed this patch with Steven and killes and they do not like the
code in node_save. Well, only a variable_get get's executed, so I do
not see that as big a problem as it is. If we do not like it, the code
can be removed, the wording changed (Steven's suggestion): "This
message will guide you through your first steps with Drupal and can be
removed through the administrative interface." However, in this case
I'd fancy putting a check in node_delete to see whether the nid=0 gets
deleted and if it is so, I'd reset the welcome_node_present variable.
I'd not like to get rid of that variable, 'cos I think this is a very
special page, and deserves the special treatment in node_default_page,
and without this variable, I'd need to query the node table if I want
the special formatting code to run.
Dries, I await your decision.


------------------------------------------------------------------------

March 4, 2005 - 01:47 : Steven

I think we should get rid of the special treatment, as it is a lot of
hassle for something so simple. We can prevent links from showing up by
setting the teaser and body equal (can do this with an extra SQL query
in db.sql to avoid repeating the text there), and denying comments.
We should also probably put the first sentence "Welcome to your new
Drupal-powered website" in the node title and remove it from the body.
We could change the theme defaults so stories don't show "submitted by"
by default. This does make sense as well if you consider them to be site
articles, whereas blogs being the more personal node type.


------------------------------------------------------------------------

March 4, 2005 - 07:13 : Dries

+1 on making it a node
-1 on using a special variable
-1 on modifying node_save()
-1 on storing PHP code in the node body
I'm OK with this but why the special treatment?  Let people manually
delete the node when they want to get rid of it.


------------------------------------------------------------------------

March 4, 2005 - 07:21 : tangent

Admins may also just edit the initial node instead of deleting it and
creating a new one.


------------------------------------------------------------------------

March 5, 2005 - 14:43 : Steven

Dries: the PHP code is there to make the message be a) localizd b) adapt
to clean URLs.


------------------------------------------------------------------------

March 5, 2005 - 17:56 : Bèr Kessels

What about either:
making all negative nids special nodes (mission, password-emails etc)
OR
making all nodes under 100 special nodes. 
That way we do not just solve a sinlge issue, but leave our options for
scalability and expandability open. 
0 is just one number.....


------------------------------------------------------------------------

March 5, 2005 - 20:45 : tangent

Implementing "special < 100" on sites with existing nodes would be
difficult.


------------------------------------------------------------------------

March 5, 2005 - 21:17 : chx

Attachment: http://drupal.org/files/issues/node0.patch (7.27 KB)

It seems that the Greater Drupal Gods wish sg. like this.





More information about the drupal-devel mailing list