I just did a quick pass through the .module file and cleaned the code a bit.

  • reformat code according to drupal code style
  • changed and added some comments
  • array_unshift instead of array_merge in the hook_element_info_alter
  • fixed a little bug: not required elements with value 0 shouldn't be treated as 'empty'
  • changed form_set_error to form_error

todo:

  • add comments to rule/filter callbacks instead of a single one above the whole block
  • perhaps use filter_var instead of custom checks/regexes/etc
CommentFileSizeAuthor
#2 2604526-2.patch7.6 KBspadxiii

Comments

SpadXIII created an issue. See original summary.

spadxiii’s picture

StatusFileSize
new7.6 KB
pedrofaria’s picture

Your patch was ported to Drupal 8 version. Thanks!

  • SpadXIII authored 8d9dace on 8.x-2.x
    Issue #2604526 by SpadXIII: Code cleanup
    
astonvictor’s picture

Since, it's committed then we can close it.

astonvictor’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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