That code is pretty hard to read, with the very long lines and the high level of nesting.
As per http://drupal.org/node/1619392#comment-6427312, some judicious use of continue statements will dramatically reduce that, and make the function much cleaner.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | nodequeue_extras-refactor_nesting-1920700.patch | 5.56 KB | jweowu |
Comments
Comment #1
jweowu commentedThis patch incorporates the fix from #1619392: Errors given when creating view (as per the second patch in comment #6), and significantly reduces the amount of nesting in the function.
I've also added a variable check to (optionally) disable the contextual links (if you only want the relationship from this module), but have not otherwise modified the function logic -- this is mostly to make the existing code more readable.
This patch requires the coding standards patch from http://drupal.org/node/1619400#comment-6427070 to be applied first.
Comment #2
jweowu commentedComment #2.0
jweowu commentedLinked to previous related comment
Comment #3
azinck commentedMerged to 1.x-dev. Thanks!