Comments

Ashish.Dalvi created an issue. See original summary.

ashishdalvi’s picture

Issue summary: View changes
ashishdalvi’s picture

Issue summary: View changes
joshi.rohit100’s picture

It seems like that in the enthusiasm of porting module, we are going in wrong directions. I haven't used this module but as per module page (and code), what i have understood is that it is used to show the block to those users which belongs to particular country and this country is determined by the users (request's) IP address. right ?

To determine the country by IP address, we are using another module (ip2country) so we don't need to worry about that. right ? Means by ip2country module, we will get the IP's country.

Now all we have to do is to show a block based on that country ?

Please correct me If I understood something wrong.

ashishdalvi’s picture

Yes. @joshi.rohit100,

Your understanding about module functionality is correct. We have to display blocks country specific.

What will be the better approach to Migrate this module to D8? I am pretty new to D8 development. So Any help will be appreciated.

Thanks,
Ashish

joshi.rohit100’s picture

Instead of migrating the whole D7 functionality as it is in D8, just create one simple condition plugin and that will do all the stuff.

joshi.rohit100’s picture

i will try write the patch for same as I get the time.

joshi.rohit100’s picture

Created issue for same #2673832: Add country_check condition plugin . Just override evaluate as per your need and add dependency for ip2country module. it Will do the rest.

naveenvalecha’s picture

#4,
Well nice! #2673832: Add country_check condition plugin good start, have a concern regarding it.

The module also alters the admin/structure/block list by ip address,
For this do we need a new BlockCountryContext which would extend BlockConditionContextSubscriberBase for adding the context countryip to filter the result by country ?

or you have something else cool for it ?

joshi.rohit100’s picture

Actually we don't need to do anything for that because in D7 altering (modifying) block list page means whether block will render or not. In D7, module simply sets the settings in form alter but that setting is not doing anything by itself. To make that settings work, block list is being altered and in D8 we don't need this. condition plugin does that for us.

naveenvalecha’s picture

cool! Well should we rely on the ipcountry module for the ip context or just provide/add our own context for the country based on ip ?

joshi.rohit100’s picture

Anyhow, we have to rely on third party library to get country by IP. Now whether we use ip2country or other. I don't see the use to create own library for this.

naveenvalecha’s picture

cool! for the context provider it will be taken care into this https://www.drupal.org/node/2659360

naveenvalecha’s picture

Issue summary: View changes
naveenvalecha’s picture

Title: [Meta] Block Country D8 port meta issue » [D8] Block Country
Category: Task » Plan
Issue summary: View changes
Issue tags: -D8 porting
naveenvalecha’s picture

Title: [D8] Block Country » [block_country] Block Country
Project: Block Country » Drupal 8 Contrib Porting Tracker
Version: 8.x-1.x-dev » 8.x-0.x-dev
Component: Code » Module
Category: Plan » Task
MustangGB’s picture

Category: Task » Plan