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

drumm drupal-devel at drupal.org
Tue Aug 16 23:17:31 UTC 2005


Issue status update for 
http://drupal.org/node/18340
Post a follow up: 
http://drupal.org/project/comments/add/18340

 Project:      Drupal
 Version:      cvs
 Component:    node.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  chx
 Reported by:  chx
 Updated by:   drumm
-Status:       patch (code needs review)
+Status:       patch (code needs work)

I am okay with this approach. Will be nice to not have the message hard
coded in node_page_default() when other node listing pages (blog,
taxonomy, etc) have no such thing.


Although, I can't get it to apply.




drumm



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

Thu, 03 Mar 2005 23:22:05 +0000 : 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.




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

Fri, 04 Mar 2005 00:10:10 +0000 : 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.




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

Fri, 04 Mar 2005 00:47:51 +0000 : 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.




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

Fri, 04 Mar 2005 06:13:05 +0000 : 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.




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

Fri, 04 Mar 2005 06:21:09 +0000 : tangent

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




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

Sat, 05 Mar 2005 13:43:16 +0000 : Steven

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




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

Sat, 05 Mar 2005 16:56:03 +0000 : 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.....




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

Sat, 05 Mar 2005 19:45:10 +0000 : tangent

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




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

Sat, 05 Mar 2005 20:17:37 +0000 : chx

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

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




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

Sat, 05 Mar 2005 20:19:31 +0000 : chx

Attachment: http://drupal.org/files/issues/node0_0.patch (7.16 KB)

totally broken patch :(




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

Sun, 06 Mar 2005 10:08:32 +0000 : Dries

I haven't tested this patch yet but except for the inconsistent use of
whitespaces, it looks about right. What is the date set to?  It might
be a good idea to insert the current date, if feasible.




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

Thu, 07 Apr 2005 21:40:45 +0000 : chx

Attachment: http://drupal.org/files/issues/welcome_0.patch (6.21 KB)

Vauxia corrected the pgsql part, thanks! I corrected the mysql part. And
yes, the created and changed time is now the time of the DB import.


Freshly rolled proper CVS diff. (I begin to enjoy this CVS diff thing.)




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

Fri, 08 Apr 2005 13:02:01 +0000 : Dries

Why not set an author?  When you try to edit/delete this node (it shows
up on "administer - content"), you are presented with a lot of
warnings.  It makes for a bad out-of-the-box experience.


Also, this patch introduces a serious bug.  You can't create a second
story.


Lastly, please correct the use of whitespace around '=' in SQL queries.




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

Mon, 11 Apr 2005 22:28:34 +0000 : chx

Attachment: http://drupal.org/files/issues/welcome1.patch (10.15 KB)

nid is 1 now. spaces are inserted. sequences updated.




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

Mon, 11 Apr 2005 22:56:08 +0000 : chx

Attachment: http://drupal.org/files/issues/welcome1_0.patch (6.34 KB)

I diffed a little too much.







More information about the drupal-devel mailing list