[drupal-devel] [bug] Fix a serious bug and clean up teaser
generation
JonBob
drupal-devel at drupal.org
Thu Mar 17 13:57:06 UTC 2005
Issue status update for http://drupal.org/node/18836
Project: Drupal
Version: cvs
Component: node system
Category: bug reports
Priority: normal
Assigned to: Goba
Reported by: Goba
Updated by: JonBob
Status: patch
-1 on using the node reference; some node types need to extract the
teaser from a field or collection of fields not named "body."
The other patch looks fine to me, but I haven't tried running it.
JonBob
Previous comments:
------------------------------------------------------------------------
March 13, 2005 - 09:37 : Goba
Attachment: http://drupal.org/files/issues/Drupal.teaser-bugfix-and-cleanup.patch (4.48 KB)
The node teaser generator keeps the whole body as the teaser, if there
is indication that PHP code is included in the body (since it is
unkown, what is going to come out of the PHP parser). The only serious
problem is that it does not check if the PHP filter is included in the
input format, so it does keep the complete body even if there is no PHP
parsing on the code. This breaks PHP code examples in articles or blog
posts, which are not supposed to be parsed, but which require proper
teasers.
The solution is to make the teaser generation code aware of the input
format (pass the whole node), and let it provide the teaser that way,
depending on the input format.
The attached patch also cleans up that very unprofessionaly looking
sequence of copy-pasted stuff in the node_teaser function.
------------------------------------------------------------------------
March 13, 2005 - 09:50 : Goba
Attachment: http://drupal.org/files/issues/Drupal.teaser-bugfix-and-cleanup-alternate.patch (4.07 KB)
Here is an alternate approach, which does not take the node as
reference, but asks for the body and the format, and then returns the
teaser, as before. Pick this or the previous one, or suggest something
else :)
------------------------------------------------------------------------
March 17, 2005 - 07:59 : Goba
Is someone willing to review these fine patches? Either one :)
More information about the drupal-devel
mailing list