Code clean-up
sun - August 25, 2007 - 20:21
| Project: | Filter Default |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
I have cleaned the coding style according to Drupal Coding Standards In preparation for porting this module to Drupal 5.
| Attachment | Size |
|---|---|
| filter_default.module.patch | 8.03 KB |

#1
Fixed a syntax error.
#2
I just ported this to D5 and created a D5 development release. I've updated the code style to my current standards for contrib modules. Please re-submit any additional problems as a new issue. Thanks!
#3
How comes that I do not see a DRUPAL-5 branch?
Attached is a new patch against HEAD. Already thoroughly tested on two productive sites.
#4
This patch does not apply cleanly for me on patching filter_default.info. I get the following filter_default.info.rej file:
****************** 1,3 ****
; $Id: filter_default.info,v 1.1 2007/09/12 20:40:39 bjaspan Exp $
name = Filter Default
description = Allows each role to have a default input format for nodes and comments.
--- 1,5 ----
; $Id: filter_default.info,v 1.1 2007/09/12 20:40:39 bjaspan Exp $
name = Filter Default
description = Allows each role to have a default input format for nodes and comments.
+ dependencies = filter
+ package = Content
It does apply cleanly on filter_default.module. I applied filter_default_3.patch directly to the 5.x-1.x-dev version; should I have applied the other patches in succession first?
#5
Attached patch cleans the coding-style of filter_default adhering to Drupal Coding Standards, and fixes some minor bugs in current HEAD.
Btw: There is still no DRUPAL-5 branch visible in CVS. I have no clue, how you managed to release a development snapshot for 5.x, but for an official release, we need to branch filter_default to DRUPAL-5 and create a DRUPAL-5--1-0 tag afterwards.
These are the included fixes:
admin/settings/filters/defaultshould display a proper page title.!list_linkwould be the proper placeholder for HTML markup like hyperlinks, however, the stringlist tabwould not be translatable, and thus, only the URL is passed tot()as replacement now.<?php- for ($i = 1; $i < count($roles)+1; $i++) {
+ for ($i = 1, $ii = count($roles); $i <= $ii; $i++) {
?>
filter_default_admin_defaults_form_validate()for better readability. This time, I additionally included some inline comments for better understanding of the rather complex logic (thoroughly tested)._filter_default_form_alter_filters()needs to additionally check if there are any children to iterate over. I already added this check in my last patch, since I encountered an error message somewhere (unfortunately I do not remember anymore, where)._filter_default_is_new().#6
#5 applied , it's huge, thanks.
#7
Barry?
#8
Barry has passed the torch. I've been working on issues, and just rolled a 1.0 release of this module to get the ball rolling, but I'll look at these next.