theme_filter_tips() takes an argument $extra that is never used and can be safely removed.

I've searched through all files in core, and it's only invoked by Filter module itself.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Status: Needs review » Needs work

If this really has no use, we should remove it from the theme function declaration in hook_theme().

sun’s picture

Status: Needs work » Needs review
FileSize
3.32 KB

Boy, I needed to lookup multiple functions to grasp what's actually passed there in $tips.... so I added an example.

Dries’s picture

     $extra = '<p>' . l(t('More information about formatting options'), 'filter/tips') . '</p>';
-    $tiplist = theme('filter_tips', $tips, FALSE, $extra);
+    $tiplist = theme('filter_tips', $tips, FALSE);

Note that $extra is now an unused variable. It is, after all, declared. It looks like the the "More information about formatting options" gets lost now?

sun’s picture

Good catch, but only true for filter_admin_format_form(). Fixed the appending of the more link there, which was not displayed until now, and also did not use the corresponding theme function...

Please note that we most probably want to refactor the whole processing and theming of filter tips (and the ($extra) more link) anyway, but let's discuss this in a new issue and not this one, please. Code clean-up should come first.

Dries’s picture

I think this is a good patch, although the @code example tends to raise questions (e.g. what is ID for?). I'm not mandating we add more documentation, so I'll commit this after someone else has reviewed this.

sun’s picture

I agree that ID should be explained as well. Hopefully ready to go now.

sun’s picture

Fixed typo "intented".

Dries’s picture

Status: Needs review » Fixed

Committed it to CVS HEAD. The extra documentation pushed it over the threshold. ;-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.