Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zone Listing Selection Dropdown Doesn't List All Zones #72

Closed
BIueRich opened this issue Jun 15, 2024 · 5 comments
Closed

Zone Listing Selection Dropdown Doesn't List All Zones #72

BIueRich opened this issue Jun 15, 2024 · 5 comments
Labels

Comments

@BIueRich
Copy link

Bug Report

If you have a Cloudflare Account with numerous zones (we have about 80), the dropdown selection once verifying your API credentials, does not show all zones, and repeats some zones. Or most likely confusing some domain name pairings with other zones ids and incorrectly listing them by name.

Additionally, if you don't verify credentials first and simply add in the zone ID into the text field and save, it generates an internal error and Admin is no longer accessible. We had to remove plugin to get admin working again.

Plugin Version

putyourlightson/craft-cloudflare:^2.1.0

Craft CMS Version

4.10.0

PHP Version

8.1

@BIueRich BIueRich added the bug label Jun 15, 2024
@bencroker
Copy link
Contributor

If you have a Cloudflare Account with numerous zones (we have about 80), the dropdown selection once verifying your API credentials, does not show all zones, and repeats some zones.

The zones are output as retrieved from Cloudflare’s API, which you can test using CURL as follows:

curl --request GET \
  --url https://api.cloudflare.com/client/v4/zones \
  --header 'X-Auth-Email: [email protected]' \
  --header 'X-Auth-Key: 1234567890' \
  --header 'Content-Type: application/json'

Additionally, if you don't verify credentials first and simply add in the zone ID into the text field and save, it generates an internal error and Admin is no longer accessible. We had to remove plugin to get admin working again.

I’ve addressed this issue in 0151146, which should prevent the error from causing a timeout. If you continue to get errors then please check the storage/logs/web-*.log files for specific errors.

@BIueRich
Copy link
Author

Hi there.. Thanks for the update. A few things I discovered however.
First, if I verify credentials in the plugin for the API, the dropdown will list a max of 50 zones. We have just over 100 I think, but certainly this exact number seems to be that the results are being limited.

Second, I noticed that the internal server error if I tried to save the settings was a result of CKEditor Plugin not having settings (disabling this plugin allowed the Cloudflare plugin settings to save).

I can see that it did save the zone ID I specified in my project.yaml file, but due to the above 50 zone limitation, it still doesn't show the zone selected in the dropdown.

Thanks

@bencroker
Copy link
Contributor

bencroker commented Jun 17, 2024

First, if I verify credentials in the plugin for the API, the dropdown will list a max of 50 zones.

Pagination wasn’t working correctly and has been fixed in d6e0cf4, please let me know if that resolves it for you.

Second, I noticed that the internal server error if I tried to save the settings was a result of CKEditor Plugin not having settings (disabling this plugin allowed the Cloudflare plugin settings to save).

That sounds unusual but thanks for the heads-up.

@BIueRich
Copy link
Author

That fixed it! Thanks for your work.
As FYI, this is what seemed to conflict or show in the logs when I got internal errors, which I had not actually setup CKEditor and maybe was the cause for ANY plugin trying to save the project.yaml file. Once disabling CKEditor, Cloudflare plugin saved.

2024-06-17 12:49:35 [web.WARNING] [application] Attempting to set settings on a plugin that doesn't have settings: ckeditor

@bencroker
Copy link
Contributor

Great! Released in 2.1.1 and 3.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants