[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
Fri Mar 4 00:10:12 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

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.


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.





More information about the drupal-devel mailing list