1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ -----------------------------------------------------------------
Line src/Plugin/Condition/BlockCountry.php
------ -----------------------------------------------------------------
61 Unsafe usage of new static().
💡 Consider making the class or the constructor final.
106 Call to deprecated function ip2country_get_country():
in ip2country:8.x-1.9 and is removed from ip2country:8.x-2.0.
Use the ip2country.lookup service instead. For example,
\Drupal::service('ip2country.lookup')->getCountry($ip_address).
------ -----------------------------------------------------------------
[ERROR] Found 2 errors
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | block_country-D9-fix-3128809-10.patch | 2.73 KB | swarad07 |
| #3 | block_country-D9-fix-3128809-3.patch | 2.73 KB | swarad07 |
Comments
Comment #2
swarad07Comment #3
swarad07Added patch to fix deprecated code issue.
The output of drupal-check post this patch,
vendor/bin/drupal-check -ad modules/contrib/workspace/block_country
1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ -------------------------------------------------------
Line src/Plugin/Condition/BlockCountry.php
------ -------------------------------------------------------
72 Unsafe usage of new static().
💡 Consider making the class or the constructor final.
------ -------------------------------------------------------
Keep the static usage the same for consistency.
Comment #4
govind.maloo commented@swarad07 : This still requires more work as drupal automated test failed.
Comment #5
swarad07Hi @govind, the build for PHP 7 & MySQL 5.5, D8.9 was successful. The failed build was for 5.6 which threw composer error.
Comment #6
swarad07Comment #7
govind.maloo commentedComment #8
govind.maloo commentedPlease use correct service
$container->get('ip2country.lookup')
Comment #9
swarad07Comment #10
swarad07Thanks for catching the typo, updated the patch.
Comment #11
govind.maloo commentedThanks, @swarad07
looks good now.
Comment #13
ashishdalviThank you @govind.maloo and @swarad07