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

Shortcode signup fails if customfields are not set. #92

Open
tedmsuperstar opened this issue Dec 15, 2020 · 0 comments
Open

Shortcode signup fails if customfields are not set. #92

tedmsuperstar opened this issue Dec 15, 2020 · 0 comments

Comments

@tedmsuperstar
Copy link

tedmsuperstar commented Dec 15, 2020

When I try to sign up through the shortcode with any email address, the list is updated on the sailthru side, but the server throws a 500 and the user doesn't see a "Thank You" message.

$customfields is initialized here: https://github.com/sailthru/sailthru-wordpress-plugin/blob/master/widget.subscribe.php#L122

In wordpress, the get_option call will return false if the option has never been set. This is the case if no custom options have ever been set. (It will return an array if the options have been set but then deleted. This cause doesn't cause a 500.)

the signature of the function should_send_welcome_template requires $customfields to be an array, so it fails on this line and throws a 500 if the wordpress user has never configured a custom field https://github.com/sailthru/sailthru-wordpress-plugin/blob/master/widget.subscribe.php#L431

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

No branches or pull requests

1 participant