Problem/Motivation

The Cloudflare module only lets me select one zone ID, but I have a multilingual site with several domains:

example.com
example.co.uk
example.cn, etc.

Each of those domains is associated with a different Cloudflare Zone ID. I can only choose one of those Zone IDs for the Cloudflare/purge integration to work with.

Proposed resolution

?

Remaining tasks

?

User interface changes

?

API changes

?

Data model changes

?

Comments

Les Lim created an issue. See original summary.

les lim’s picture

Here's a patch that hacks CloudFlarePurger's URL invalidation mechanism, getting a list of zones from the API and separating the list of URLs into groups that can be run against each zone. It disregards the configured CloudFlare zone entirely.

This wouldn't be appropriate to include in the module as-is, but does demonstrate a possible approach.

gustavorf90’s picture

StatusFileSize
new6.78 KB

_

gustavorf90’s picture

gustavorf90’s picture

gustavorf90’s picture

Added a patch that hacks CloudFlare module add multiple zones (domains)
Zone field was textfield now it is select field. You can select multiple zones.

dishabhadra’s picture

Version: 8.x-1.x-dev » 8.x-1.0-alpha11
Related issues: +#2915341: Proposal to switch Cloudflare library
StatusFileSize
new6.36 KB

I have created a patch for this feature using the following:

dishabhadra’s picture

StatusFileSize
new25.63 KB

Adding a new patch here which contains the following:

  • My Code for adding Support of multiple zones for multiple domains
  • Code from this patch

Rest all remains the same as per #7

abhaysaraf’s picture

er.garg.karan’s picture

Version: 8.x-1.0-alpha11 » 8.x-1.0-beta2
Priority: Normal » Major
StatusFileSize
new15.4 KB

I'm contributing a patch for the latest version with some major improvements in the original code.

er.garg.karan’s picture

StatusFileSize
new15.42 KB

The last patch saves empty zone ids when not provided for any of the language domains. Contributing a new patch to handle that problem.

rosk0’s picture

Status: Active » Closed (duplicate)