I have cleaned the coding style according to Drupal Coding Standards In preparation for porting this module to Drupal 5.

Comments

sun’s picture

StatusFileSize
new8.03 KB

Fixed a syntax error.

bjaspan’s picture

Status: Needs review » Closed (won't fix)

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!

sun’s picture

Title: Code clean-up » Port to 5.x & code clean-up
Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Closed (won't fix) » Needs review
StatusFileSize
new6.75 KB

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.

john bickar’s picture

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?

sun’s picture

Title: Port to 5.x & code clean-up » Code clean-up
StatusFileSize
new8.22 KB

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:

  • The .info file should declare a package.
  • admin/settings/filters/default should display a proper page title.
  • !list_link would be the proper placeholder for HTML markup like hyperlinks, however, the string list tab would not be translatable, and thus, only the URL is passed to t() as replacement now.
  • This repeatedly used for-condition is executed for each iteration, and thus replaced with a faster and better understandable syntax:
    -  for ($i = 1; $i < count($roles)+1; $i++) {
    +  for ($i = 1, $ii = count($roles); $i <= $ii; $i++) {
    
  • Like in my previous patch, I've altered 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).
  • The last if-condition in _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).
  • Added the missing form_id for user-created blocks to _filter_default_is_new().
idflorin’s picture

#5 applied , it's huge, thanks.

sun’s picture

Barry?

chellman’s picture

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.

pomliane’s picture

Status: Needs review » Closed (won't fix)

This version of Filter Default is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.