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

Comments

piyuesh23 created an issue. See original summary.

swarad07’s picture

Assigned: Unassigned » swarad07
swarad07’s picture

Status: Active » Needs review
StatusFileSize
new2.73 KB

Added 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.

govind.maloo’s picture

Status: Needs review » Needs work

@swarad07 : This still requires more work as drupal automated test failed.

swarad07’s picture

Hi @govind, the build for PHP 7 & MySQL 5.5, D8.9 was successful. The failed build was for 5.6 which threw composer error.

swarad07’s picture

Status: Needs work » Needs review
govind.maloo’s picture

Assigned: swarad07 » govind.maloo
govind.maloo’s picture

Status: Needs review » Needs work
+++ b/src/Plugin/Condition/BlockCountry.php
@@ -61,6 +72,7 @@ class BlockCountry extends ConditionPluginBase implements ContainerFactoryPlugin
+      $container->get('ip2_country_lookup'),

Please use correct service

$container->get('ip2country.lookup')

swarad07’s picture

Assigned: govind.maloo » swarad07
swarad07’s picture

Assigned: swarad07 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.73 KB

Thanks for catching the typo, updated the patch.

govind.maloo’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, @swarad07
looks good now.

  • ashishdalvi committed 64b6f82 on 8.x-1.x authored by swarad07
    Issue #3128809 by swarad07, govind.maloo: [META] Make Block Country...
ashishdalvi’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Drupal 9 porting day

Thank you @govind.maloo and @swarad07

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.