Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are problems in nodewords_metatag_from_node_content():
- Bug: The strip_tags() call is completely ignored.
- Task: The code is confused by use of $text when the $result variable already exists.
- Task: The _nodewords_teaser_match_callback() could be just merged inline.
- Feature: It doesn't IMHO make sense that the alt tags of an image be added inline, possibly within a sentence, there should at least be a way of customizing it so that e.g. it's wrapped in parenthesis.
- Task: In the interest of code simplicity, each filter call should be separate rather than stacked.
- Task: There's no way of customizing a global regex for filtering node teaser output, so there's no point in keeping the code in nodewords_metatag_from_node_content().
- Task: Move the php filter check higher up in the function to avoid wasting processing time.
Comment | File | Size | Author |
---|---|---|---|
#5 | nodewords-n1850414-5.patch | 5.93 KB | DamienMcKenna |
#3 | nodewords-n1850414-3.patch | 5.93 KB | DamienMcKenna |
#1 | nodewords-n1850414-1.patch | 6.3 KB | DamienMcKenna |
Comments
Comment #0.0
DamienMcKennaMerged #1850402.
Comment #1
DamienMcKennaThis patch resolves the issues noted above, along with another few improvements for code style, comments, etc.
Comment #2
DamienMcKennaI need to test that the regex functionality still works, then I'll commit it.
Comment #3
DamienMcKennaA slight rearranging of the code, moved the php-check slightly higher up.
Comment #5
DamienMcKennaForgot to rename a hook_update_N() call after another update was added elsewhere.
Comment #6
DamienMcKennaAfter some further testing I think this is fine - it doesn't really change anything (other than wrapping the alt text in parenthesis), just cleans up the code and fixes a typo introduced in 1.13. Committed.
Comment #7.0
(not verified) CreditAttribution: commentedAdded an item for moving the PHP filter higher up.