Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I really appreciate this module, but I had a hard time reading the code.
This patch re-writes a lot of the code according to Drupal's coding standards.
And I've provided the whole lot as a ZIP file, in case it's easier to read that way.
Comment | File | Size | Author |
---|---|---|---|
#24 | correct_screen2022-05-16 11-38-06.png | 143.46 KB | matheusmaciel |
#24 | error_screen_2022-05-16 11-31-59.png | 376.96 KB | matheusmaciel |
#24 | arrow.png | 75.43 KB | matheusmaciel |
#17 | 2012962-17.patch | 11.38 KB | anabpv |
#8 | 2012962-Drupal-Coding-Standards.patch | 4.9 KB | darol100 |
Issue fork scroll_to_top-2012962
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2012962-coding-standards changes, plain diff MR !1
Comments
Comment #1
tarekdj CreditAttribution: tarekdj commentedIssue marked for Tunisian local sprint next week.
Comment #2
willieseabrook CreditAttribution: willieseabrook commentedI have rerolled the patch against 7.x-2.x latest. See attached
Comment #3
Chi CreditAttribution: Chi commentedThe patch is outdated.
Comment #4
darol100 CreditAttribution: darol100 commentedComment #5
darol100 CreditAttribution: darol100 commentedI have created a new patch that will fix all Drupal standards coding errors.
I only have one warning that I did not figure out how to fix it.
Comment #6
darol100 CreditAttribution: darol100 commentedComment #7
Chi CreditAttribution: Chi commentedI think it's a bad practice using t() function for variable translation. Here are some explanations: http://hojtsy.hu/blog/2011-may-19/drupals-multilingual-problem-why-t-wro...
Common way to translate variables is using i18n module. https://www.drupal.org/node/1113374
Comment #8
darol100 CreditAttribution: darol100 commented@Chi
Thank you for the amazing resources.
I have created another patch where will fix ALL Drupal Coding Standards errors.
Comment #9
darol100 CreditAttribution: darol100 commentedComment #10
jwilson3Comment #11
darol100 CreditAttribution: darol100 commentedWhat is Needs to reroll means ?
Comment #12
tarekdj CreditAttribution: tarekdj commentedNeeds reroll means that the code changed and the patch does not apply anymore.
https://www.drupal.org/contributor-tasks/reroll
Comment #13
darol100 CreditAttribution: darol100 commentedI can submitted an updated version of the patch. But would be possible to give it a priority so this does not have to be re-rolling over and over again ?
Comment #14
dhanushka madushan CreditAttribution: dhanushka madushan commentedthe patch applied cleanly
Comment #16
anabpvI will work on this issue
Comment #17
anabpvI ran phpcs and phpcbf and fixed most issues.
The ones that still need to be fixed are these:
Since these errors still need to be corrected, I'm changing the status to Needs Work.
Comment #18
Johnny Santos CreditAttribution: Johnny Santos at CI&T commentedOk, im going for this
Comment #19
Johnny Santos CreditAttribution: Johnny Santos at CI&T commentedJust an update, I applied the last patch and run phpcs as well as phpcbf and what I got was this, as listed below:
FILE: ...t-drupal_useful_scripts-20f10c7ee60f/d7webform/sites/all/modules/scroll_to_top/scroll_to_top.admin.inc
------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 3 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------
3 | ERROR | Missing short description in doc comment
6 | WARNING | PHP version not specified
6 | ERROR | Missing @category tag in file comment
6 | ERROR | Missing @package tag in file comment
6 | ERROR | Missing @author tag in file comment
6 | ERROR | Missing @license tag in file comment
6 | ERROR | Missing @link tag in file comment
10 | ERROR | Missing @return tag in function comment
11 | ERROR | Function name "scroll_to_top_settings" is prefixed with a package name but does not begin
| | with a capital letter
11 | ERROR | Function name "scroll_to_top_settings" is invalid; consider "Scroll_To_Top_settings"
| | instead
17 | WARNING | Line exceeds 85 characters; contains 89 characters
64 | WARNING | Line exceeds 85 characters; contains 171 characters
Comment #20
Johnny Santos CreditAttribution: Johnny Santos at CI&T commentedPlease do not consider my last comment, I used the wrong standart, instead of Drupal's.
Comment #22
Johnny Santos CreditAttribution: Johnny Santos at CI&T commentedOk, so after using phpcs with the right standart, I got the same log as the comment #17.
Worked on it, and now its pushed and fixed.
Changing to needs review status.
Comment #23
matheusmaciel CreditAttribution: matheusmaciel at CI&T commentedI'll review it!
Comment #24
matheusmaciel CreditAttribution: matheusmaciel at CI&T commentedI reviewed the issue with the phpcs and everything looks fine.
The "arrow.png" file shows that the module still works.
The "error_screen_2022-05-16 11-31-59.png" file shows the phpcs error messages.
And lastly, the "correct_screen2022-05-16 11-38-06.png" file shows the phpcs output (which is none) after the last commited work done.
Comment #25
matheusmaciel CreditAttribution: matheusmaciel at CI&T commented