- Issue created by @urvashi_vora
- Status changed to Needs work
almost 2 years ago 1:25pm 6 July 2023 - 🇵🇭Philippines roberttabigue
Hi @urvashi_vora,
Your patch provided didn't work on my end.
I applied your patch to the Dependent Country, State and City module against 1.0.6.
Ran this command on the module:
curl https://www.drupal.org/files/issues/2023-07-06/coding-standard-fixes_10.patch | git apply -v
Please see the attached file for your reference.
Moving this to Needs work for now.
Thank you!
- Assigned to yashmalviya
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:12am 19 July 2023 - 🇮🇳India ashutosh ahirwal India
Providing a updated patch and some of the issue remaining to maintainer should look into this.
Remaining issues.
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/dependent_country_state/dependent_country_state.routing.yml
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 14 LINES
------------------------------------------------------------------------------------------------------------------------------------
7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
15 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
23 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
31 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
39 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
47 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
56 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
64 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
72 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
80 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
88 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
96 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
104 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
112 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
------------------------------------------------------------------------------------------------------------------ - 🇮🇹Italy apaderno Brescia, 🇮🇹
Since this issue does not give clear instructions for a novice user, this is not an issue for novice users.
- Status changed to Needs work
over 1 year ago 12:19pm 19 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
/** - * hook_schema() + * Hook_schema() */ function dependent_country_state_schema() {
The correct description for a hook implementation is
Implements hook_schema().
+function dependent_country_state_uninstall() { + + \Drupal::database()->schema()->dropTable('dependent_country'); + \Drupal::database()->schema()->dropTable('dependent_state'); + \Drupal::database()->schema()->dropTable('dependent_city'); + \Drupal::database()->schema()->dropTable('dependent_pincode'); +}
There is no need to put an empty line before the function first code line.
+/** + * Implements hook_form_alter(). + */ +function dependent_country_state_form_alter(&$form, FormStateInterface $form_state, $form_id) { + // if($form_id == 'dependent_country_state_city_form') { + // $form['#attached']['library'][] = 'dependent_country_state/dependent_city'; + // $form['#attached']['drupalSettings']['dependent_country_state']['city'] = + // 'Delhi'; + // }. }
The description of that hook must say which form is altered.
No period is added to commented out code. - Status changed to Needs review
over 1 year ago 9:21am 23 July 2023 - Status changed to Needs work
over 1 year ago 10:37am 23 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
diff --git a/README.md b/README.md index d11ee5d..6b24c3f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -Dependent Country State City modules extend your site functionality and provide feature to add/edit/delete Country State City and pincode/area as per your need. This module also provide API for fetching data from Database. +Dependent Country State City modules extend your +site functionality and provide feature to +add/edit/delete Country State City and pincode/area as +per your need. This module also provide API for +fetching data from Database. Go To Main Navigation -> Configuration -> Country, state and city 1. Country List @@ -9,7 +13,10 @@ Go To Main Navigation -> Configuration -> Country, state and city Country. -By Default all country added by module or you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +By Default all country added by module or you +can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: admin/city-state-city/api/get-country query parameter with id : admin/city-state-city/api/get-country?id=103 @@ -18,7 +25,10 @@ query parameter with name : admin/city-state-city/api/get-country?country_name=I State. -By Default all india states added by module or you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +By Default all india states added by module or +you can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: /admin/city-state-city/api/get-state/103 here 103 mean country ID: @@ -28,7 +38,10 @@ query parameter with name : /admin/city-state-city/api/get-state/103?state_name= City. -There is no default data added by module but you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +There is no default data added by module but +you can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: /admin/city-state-city/api/get-city/32 here 32 mean state ID: @@ -38,7 +51,10 @@ query parameter with name : /admin/city-state-city/api/get-city/32?city_name=Del Pincode. -There is no default data added by module but you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +There is no default data added by module but +you can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: /admin/city-state-city/api/get-areapincode/2 here 2 mean city ID: @@ -46,18 +62,23 @@ here 2 mean city ID: query parameter with name : /admin/city-state-city/api/get-areapincode/2?pincode_area=11 -Note: Make sure to give right performission to right role to get access API of feature. +Note: Make sure to give right performission +to right role to get access API of feature. PLACING MODULE IN THIS DIRECTORY ------------------------------------ -You may create custom directory inside /web/module if already is not created, and place this module in web/module/custom directory, to organize your module. +You may create custom directory inside /web/module +if already is not created, and place this module +in web/module/custom directory, to organize your module. ENABLE MODULE ----------------------- -You can enabled it using drush en dependent_country_state or from User Interface (admin/modules) search your module name and click on checkbox then click on install. +You can enabled it using drush en dependent_country_state +or from User Interface (admin/modules) search your module +name and click on checkbox then click on install. HOW TO CONFIGURE. diff --git a/README.txt b/README.txt index 16627bb..44ee3f4 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,7 @@ -Dependent Country State City modules extend your site functionality and provide feature to add/edit/delete Country State City and pincode/area as per your need. This module also provide API for fetching data from Database. +Dependent Country State City modules extend your +site functionality and provide feature to add/edit/delete +Country State City and pincode/area as per your need. +This module also provide API for fetching data from Database. Go To Main Navigation -> Configuration -> Country, state and city 1. Country List @@ -9,7 +12,10 @@ Go To Main Navigation -> Configuration -> Country, state and city Country. -By Default all country added by module or you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +By Default all country added by module or +you can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: admin/city-state-city/api/get-country query parameter with id : admin/city-state-city/api/get-country?id=103 @@ -18,7 +24,10 @@ query parameter with name : admin/city-state-city/api/get-country?country_name=I State. -By Default all india states added by module or you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +By Default all india states added by module or +you can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: /admin/city-state-city/api/get-state/103 here 103 mean country ID: @@ -28,7 +37,10 @@ query parameter with name : /admin/city-state-city/api/get-state/103?state_name= City. -There is no default data added by module but you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +There is no default data added by module but +you can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: /admin/city-state-city/api/get-city/32 here 32 mean state ID: @@ -38,7 +50,10 @@ query parameter with name : /admin/city-state-city/api/get-city/32?city_name=Del Pincode. -There is no default data added by module but you can add/edit/delete as per your need. Also provide API to fetch the data in json format. Below are the API details. +There is no default data added by module +but you can add/edit/delete as per your need. +Also provide API to fetch the data in json format. +Below are the API details. End Point: /admin/city-state-city/api/get-areapincode/2 here 2 mean city ID: @@ -46,19 +61,25 @@ here 2 mean city ID: query parameter with name : /admin/city-state-city/api/get-areapincode/2?pincode_area=11 -Note: Make sure to give right performission to right role to get access API of feature. +Note: Make sure to give right performission to +right role to get access API of feature. PLACING MODULE IN THIS DIRECTORY ------------------------------------ -You may create custom directory inside /web/module if already is not created, and place this module in web/module/custom directory, to organize your module. +You may create custom directory inside /web/module if +already is not created, and place this module +in web/module/custom directory, +to organize your module. ENABLE MODULE ----------------------- -You can enabled it using drush en dependent_country_state or from User Interface (admin/modules) search your module name and click on checkbox then click on install. +You can enabled it using drush en dependent_country_state +or from User Interface (admin/modules) search +your module name and click on checkbox then click on install.
All those lines have been limited to 40/60 characters when they should not exceed 80 characters. not exceed 80 characters means getting as close as possible to 80 characters without splitting a word or a URL on two lines.
diff --git a/dependent_country_state.install b/dependent_country_state.install index 2ed753b..e30784f 100644 --- a/dependent_country_state.install +++ b/dependent_country_state.install @@ -2,215 +2,226 @@ /** * @file - * Helps to create database for storing voucher data. + * Helps to create the database for storing voucher data. */
The description for a .install file is Install, update, and uninstall functions for the [module name] module. where [module name] is the module name reported in the .info.yml file.
/** - * hook_schema() + * Implements hook_uninstall(). + * + * Uninstalls the Dependent Country State module + * and drops the module-related tables from the database. */ -function dependent_country_state_schema() { +function dependent_country_state_uninstall() { + // Remove the database tables defined in hook_schema(). + // The tables will be dropped automatically during module uninstallation. + $schema = dependent_country_state_schema(); + foreach ($schema as $table_name => $table_schema) { + db_drop_table($table_name); + } +} - $schema['dependent_country'] = array( - 'description' => 'Store Country table defination', - 'fields' => array( - 'id' => array( +/** + * Implements hook_schema(). + * + * Defines the database schema for the Dependent Country State module. + */
The long description is not necessary, since it just describes what that hook does.
/** * @file * Primary module hooks for Dependent Country State Module. */
There are not primary hooks on Drupal.
The description to use is Hook implementations for the Dependent Country, State and City module.+/** + * Implements hook_form_alter(). + * + * Custom form alterations can be added here + * For the Dependent Country State module. + */ +function dependent_country_state_form_alter(&$form, FormStateInterface $form_state, $form_id) {
The short description must say which form is altered.
The long description is not necessary, since the only information it gives is the module that implements it (although it does not use the correct module name).-dependent_country_state.country: - path: '/admin/config/dependent-state-city/list-country' - defaults: - _controller: 'Drupal\dependent_country_state\Controller\CountryController::list' - _title: 'List Country' - requirements: - _access: 'TRUE' - -dependent_country_state.state: - path: '/admin/config/dependent-state-city/list-state' - defaults: - _controller: 'Drupal\dependent_country_state\Controller\StateController::list' - _title: 'List State' - requirements: - _access: 'TRUE' - -dependent_country_state.state_add: - path: '/admin/config/dependent-state-city/state/add' - defaults: - _form: '\Drupal\dependent_country_state\Form\AddStateForm' - _title: 'Add States' - requirements: - _access: 'TRUE' - -dependent_country_state.country_add: - path: '/admin/config/dependent-state-city/country/add' - defaults: - _form: '\Drupal\dependent_country_state\Form\AddCForm' - _title: 'Add Country' - requirements: - _access: 'TRUE' - -dependent_country_state.city: - path: '/admin/config/city-state-city/list-city' - defaults: - _controller: 'Drupal\dependent_country_state\Controller\CityController::list' - _title: 'City List' - requirements: - _access: 'TRUE' - -dependent_country_state.add_city: - path: '/admin/config/dependent-state-city/city/add' - defaults: - _form: '\Drupal\dependent_country_state\Form\AddCtForm' - _title: 'Add City' - requirements: - _access: 'TRUE' - - -dependent_country_state.pincode: - path: '/admin/config/dependent-state-city/list-pincode' - defaults: - _controller: 'Drupal\dependent_country_state\Controller\PincodeController::list' - _title: 'Pincode List' - requirements: - _access: 'TRUE' - -dependent_country_state.add_pincode: - path: '/admin/config/dependent-state-city/pincode/add' - defaults: - _form: '\Drupal\dependent_country_state\Form\AddPincodeForm' - _title: 'Add Pincode' - requirements: - _access: 'TRUE' - -dependent_country_state.state_list_form_delete: - path: '/admin/config/country/dependent_country_state/state/delete/{sid}' - defaults: - _form: '\Drupal\dependent_country_state\Form\DeleteStateForm' - _title: 'Delete States' - requirements: - _access: 'TRUE' - -dependent_country_state.pincode_list_form_delete: - path: '/admin/config/country/dependent_country_state/pincode/delete/{sid}' - defaults: - _form: '\Drupal\dependent_country_state\Form\DeletePincodeForm' - _title: 'Delete States' - requirements: - _access: 'TRUE' - -dependent_country_state.city_list_form_delete: - path: '/admin/config/country/dependent_country_state/city/delete/{sid}' - defaults: - _form: '\Drupal\dependent_country_state\Form\DeleteCityForm' - _title: 'Delete City' - requirements: - _access: 'TRUE' - -dependent_country_state.country_list_form_delete: - path: '/admin/config/country/dependent_country_state/country/delete/{sid}' - defaults: - _form: '\Drupal\dependent_country_state\Form\DeleteCountryForm' - _title: 'Delete Country' - requirements: - _access: 'TRUE' - -dependent_country_state.state_list_form: - path: '/admin/config/country/state/list' - defaults: - _form: '\Drupal\dependent_country_state\Form\StateForm' - _title: 'States Filter Form' - requirements: - _access: 'TRUE' - -dependent_country_state.city_list_form: - path: '/admin/config/country/city/list' - defaults: - _form: '\Drupal\dependent_country_state\Form\CityForm' - _title: 'States Filter Form' - requirements: - _access: 'TRUE'
PHP_CodeSniffer says to describe why those routes do not check who access them, not to remove them.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
Furthermore, the issue summary must show all the reported warnings/errors, not part of them.