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

TypeError on campaign start. #316

Open
bor7an opened this issue Nov 5, 2024 · 2 comments
Open

TypeError on campaign start. #316

bor7an opened this issue Nov 5, 2024 · 2 comments

Comments

@bor7an
Copy link

bor7an commented Nov 5, 2024

TypeError
str_replace(): Argument #2 ($replace) must be of type array|string, null given (View: /var/www/sendportal/resources/views/vendor/sendportal/campaigns/preview.blade.php)

PHP 8.3.6 (cli) (built: Sep 30 2024 15:17:17) (NTS)
Copyright (c) The PHP Group

image

@GwilCodes
Copy link

I guess it's expecting some content in the "Content" textarea field on the "Edit Campaign" screen. Try just putting any random string in there if the content field isn't used in your template.
Screenshot 2024-11-07 at 11 23 07

@vaclavvidon
Copy link

You can fix it by adjusting the code of sendportal-core to this:

if ($this->template_id) {
            return str_replace(['{{content}}', '{{ content }}'], $this->content ?? '', $this->template->content);
}

or you can type anything into the "Content" field. It doesn't be a "content" string as suggested by @GwilCodes, it can be any string.

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

3 participants