Fix action_argument_value of shortcode will be string if empty
[MAILPOET-4151]
This commit is contained in:
@ -151,7 +151,7 @@ class Shortcodes {
|
||||
'';
|
||||
$shortcodeDetails['action_argument_value'] = !empty($shortcodeDetails['argument_value']) ?
|
||||
$shortcodeDetails['argument_value'] :
|
||||
false;
|
||||
'';
|
||||
$shortcodeDetails['arguments'] = !empty($shortcodeDetails['arguments']) ?
|
||||
$shortcodeDetails['arguments'] : [];
|
||||
|
||||
|
@ -372,6 +372,15 @@ class ShortcodesTest extends \MailPoetTest {
|
||||
}
|
||||
}
|
||||
|
||||
public function testItCanProcessShortcodeWithEmptyDefault() {
|
||||
$shortcode = '[subscriber:lastname | default:]';
|
||||
$shortcodesObject = $this->shortcodesObject;
|
||||
$subscriberWithoutLastname = new SubscriberEntity();
|
||||
$shortcodesObject->setSubscriber($subscriberWithoutLastname);
|
||||
$result = $shortcodesObject->process([$shortcode]);
|
||||
expect($result[0])->equals('');
|
||||
}
|
||||
|
||||
public function testItCanProcessCustomLinkShortcodes() {
|
||||
$shortcodesObject = $this->shortcodesObject;
|
||||
$shortcodesObject->setWpUserPreview(false);
|
||||
|
Reference in New Issue
Block a user