- Issue created by @rassoni
- @rassoni opened merge request.
- Status changed to Needs review
over 1 year ago 8:03am 21 March 2023 - ๐ฎ๐ณIndia rassoni Bangalore
Fixed PHPCS issues and generate MR
https://git.drupalcode.org/project/logout_redirect/-/merge_requests/1
Please review. - Status changed to Needs work
over 1 year ago 2:25pm 21 March 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
-Enter url on which you wants to redirect user after logging off and if +Enter url on which you wants to redirect user after logging off and if
Since that line is changed, the change should also correctly spell URL and use redirect users instead of redirect user.
/** * @file - * This module After user logout if user click browser back button then redirect to login page. + * User click browser back button then redirect to login page. * - * Administrators can add url of page on which he want's to , + * Administrators can add url of page on which wants to * redirect if browser back button is clicked after logout. */
The usual comment is Hook implementations for [module name]. It does not need to explain the module purpose, which is already explained in its
hook_help()
implementation.- // Markup for example + // Markup for example. $form['explaination_text'] = [ '#type' => 'markup', '#markup' => $explaination_text,
That comment can be removed, since it does not explain anything already understandable from the code.
+ $form['redirect'] = [ '#type' => 'textfield', - '#title' => $this->t("Add url of page on which you want's to " - . "redirect if browser back button is clicked after logout"), - //'#required' => TRUE, + '#title' => $this->t("Add url of page on which you want's to redirect if browser back button is clicked after logout"), + // '#required' => TRUE, '#default_value' => $config->get('logout_redirect'), - ); + ];
Commented out code should be simply removed.
- First commit to issue fork.
- Status changed to Needs review
over 1 year ago 6:00am 23 March 2023 - Status changed to Needs work
over 1 year ago 12:33pm 23 March 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
/** * @file - * This module After user logout if user click browser back button then redirect to login page. - * - * Administrators can add url of page on which he want's to , - * redirect if browser back button is clicked after logout. + * Hook implementation for the logout_redirect module. */
It is Hook implementations and the module name should be shown as shown on the top of this page.
- // Markup for explaination - $explaination_text = "<div>If you log out of a Drupal site and then hit - the back button, you can see pages from the authenticated user's previous + // Markup for explanation.
The last comment is not necessary, since that is already clear from the code.
+ '#title' => $this->t("Add url of page on which you want's to + redirect if browser back button is clicked after logout"), '#default_value' => $config->get('logout_redirect'),
url is not the correct spelling of URL.
you want's to, while used in the original comment, is not grammatical.
redirect if browser back button is clicked after logout is missing an article, not using the possessive, and it would probably say after users logged out.- // Submit button + // Submit button.
It should be The submission button, but that comment is not necessary, since that is evident from the code.
+ // Set the submitted configuration setting. + ->set('logout_redirect', $logout_redirect_url) + ->save();
That comment should be placed some lines earlier, but it is not necessary, as that is understandable from the code itself.
- Status changed to Needs review
over 1 year ago 8:31am 24 March 2023 - ๐ฎ๐ณIndia kkalashnikov Ghaziabad, India
@apaderno I have updated the MR accordingly please review it.
- Status changed to Needs work
over 1 year ago 11:51am 24 March 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
-Enter url on which you wants to redirect user after logging off and if +Enter URL on which you wants to redirect users after logging off and if user press browser back button.
That sentence is still not grammatically correct. Those errors need to be corrected, since that comment is changed.
A correct sentence would be:Enter the URL to which you want to redirect users after they log off or when they press the browser's Back button.
+ * Hook implementations for the logout_redirect module.
The module name is not logout_redirect; that is its machine name. The module name is the one reported after Project: on the top of this page, which is the same name reported in the module's .info.yml file (the value for the
name
key).+ '#title' => $this->t("Add URL of page on which you want's to + redirect if browser back button is clicked after logout"), '#default_value' => $config->get('logout_redirect'),
you want's to is not grammatical. Since that line is edited, that should be corrected too.
- Status changed to Needs review
over 1 year ago 8:24am 27 March 2023 - Status changed to Needs work
over 1 year ago 8:55am 27 March 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
+Enter the URL of page on which user wants to redirect if browser back button is +clicked after logout. +
That could be grammatically correct, but it is not correct. It's not the user who wants to redirect, but the administrator user who is entering the URL.
- * Administrators can add url of page on which he want's to , - * redirect if browser back button is clicked after logout. + * Hook implementations for the logout redirect module. */
The module name should be spelled using uppercase letters where the module name uses them.
- '#title' => $this->t("Add url of page on which you want's to " - . "redirect if browser back button is clicked after logout"), - //'#required' => TRUE, + '#title' => $this->t("Add URL of page on which user wants to + redirect if browser back button is clicked after logout"), '#default_value' => $config->get('logout_redirect'),
It is the same mistake done for the previous change.
- Status changed to Needs review
11 months ago 9:27am 3 January 2024 - ๐ฎ๐ณIndia Hardik_Patel_12 India
I have solved the warnings given by PHPCS and here is the patch.
- Status changed to Needs work
11 months ago 12:42pm 3 January 2024 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
/** * @file - * This module After user logout if user click browser back button then redirect to login page. + * This module After user logout if user click browser back button + * then redirect to login page. * - * Administrators can add url of page on which he want's to , - * redirect if browser back button is clicked after logout. + * Hook implementations for the logout redirect module. */
The module name is Logout Redirect, not logout redirect. Capitalized letter must be written capitalized.
Furthermore, the@file
description for a module is just the last line. - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Furthermore, running
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml ./
, I get a slightly different report. - ๐ฎ๐ณIndia Yashaswi18
I cloned and ran the command :
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml logout_redirect/
I'm not seeing any errors except for this one.-------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 1 | ERROR | [x] End of line character is invalid; expected "\n" but found | | "\r\n" -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------
- Status changed to Needs review
9 months ago 5:47am 27 February 2024 - Status changed to Needs work
9 months ago 9:02am 28 February 2024 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
-core: 8.x core_version_requirement: ^8 || ^9
It is not necessary to remove the
core
line, if thecore_version_requirement
line is not changed.- * Rename wrong name of the config from logut_redirect_config.settings - * to logout_redirect.settings. + * To logout_redirect.settings.
That change is not correct, since to logout_redirect.settings is not a sentence on its own. It is part of the previous sentence.
/** * @file - * This module After user logout if user click browser back button then redirect to login page. - * - * Administrators can add url of page on which he want's to , - * redirect if browser back button is clicked after logout. + * This module After user logout if user click browser back button. */ +// Then redirect back to login page. +// Administrators can add page url's as per requirement. +// redirect if browser back button is clicked after logout.
The usual description for a module file is Hook implementations for the [module name] module. where [module name] is the module name reported in its .info.yml file.
Outside of functions or classes, the comment delimiter used is not
//
. We use a single documentation comment per function/method.+ // Validate if the redirect field is not empty. + $redirect_value = $form_state->getValue('redirect'); + if (empty($redirect_value)) { + $form_state->setErrorByName('redirect', $this->t('Redirect URL is required.')); + }
Verify the redirect field is not empty. is better.
Also, let's keep using merge requests.
- Assigned to nitin_lama
- Issue was unassigned.
- Status changed to Needs review
9 months ago 11:27am 28 February 2024 - ๐ฎ๐ณIndia Yashaswi18
Hello, applied MR!2, found one error remaining on running the command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
FILE: /home/yashaswi/contribs/logout_redirect/logout_redirect.install ------------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------ 11 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph ------------------------------------------------------------------------------------------------------------------
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
apaderno โ changed the visibility of the branch logout_redirect-3349252 to hidden.
- ๐ฎ๐ณIndia dev16.addweb
silvi.addweb โ made their first commit to this issueโs fork.
- Status changed to Needs work
4 months ago 12:10pm 9 July 2024 - ๐ต๐ญPhilippines cleavinjosh
Hi @silvi.addweb,
I tried to apply MR!2 but was skipped.
โ logout_redirect git:(main) โ curl https://git.drupalcode.org/project/logout_redirect/-/merge_requests/2.diff | git apply -v % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 14587 0 14587 0 0 41157 0 --:--:-- --:--:-- --:--:-- 41206 Skipped patch '.gitlab-ci.yml'. Skipped patch 'README.txt'. Skipped patch 'logout_redirect.info.yml'. Skipped patch 'logout_redirect.install'. Skipped patch 'logout_redirect.libraries.yml'. Skipped patch 'logout_redirect.module'. Skipped patch 'logout_redirect.routing.yml'. Skipped patch 'src/Form/LogoutBackConfigForm.php'. โ logout_redirect git:(main) โ
Please check and advise.
Thank you. - Status changed to Needs review
4 months ago 2:00pm 9 July 2024 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
The issue fork is eight commits ahead of the upstream repository. There is nothing that needs to be fixed in the MR.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
GitLab CI does not report any PHP_CodeSniffer warning/error which still needs to be fixed.
- Status changed to RTBC
4 months ago 5:38pm 16 July 2024 - ๐ต๐ญPhilippines roberttabigue
Hi,
I have applied the latest MR to the Logout Redirect module against 2.0.1 on Drupal 10 and confirmed all PHPCS errors have been fixed.
I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml logout_redirect
Please see the attached file for reference.
I'm moving this now to โRTBCโ.
Thank you!