Fetchit и ошибка Undefined array key "fetchit_called"

Приветствую! Не могу понять почему лезет ошибка при использовании FetchIt:

/home/b122193/public_html/core/components/fetchit/src/FetchIt.php 81
PHP warning: Undefined array key «fetchit_called»

  • Плагин и движок последней версии
  • Версия PHP 8.1,
  • Вроде все по инструкции делаю:
Вызов сниппета Fetchit
{'!FetchIt' | snippet : [
  'snippet' => 'FormIt',
  'form' => 'ContactForm.tpl',
  'hooks' => 'email',
   'emailSubject' => 'Запрос с сайта',
   'emailTo' => $emailTo,
   'emailFrom' => $fromEmail,
   'emailTpl' => 'email.tpl',
   'validate' => 'name:required,email:required,subject:required,message:required'
     ]}
Чанк с формой ContactForm.tpl:
<form action="{$_modx->resource.uri}" method="post" enctype="multipart/form-data" id="form-1">
    <input id="input-firstname" type="text" name="name"  placeholder="First Name" required />
    <input  id="input-lastname" type="text" name="lastName"  placeholder="Last Name" required />
    <input id="input-mail" type="email" name="email" placeholder="Email Address" required />
    <input  id="input-phone" type="text" name="phone" placeholder="Phone number" />
    <textarea   id="input-mes" name="message"  placeholder="Message" required></textarea>
    <button  type="submit">Send message</button>
</form>
Шаблон письма email.tpl
{if $_pls['name']}
<p><strong>Name</strong>: {$_pls['name']}</p>
{/if}
{if $_pls['lastName']}
<p><strong>Last name</strong>: {$_pls['lastName']}</p>
{/if}
{if $_pls['phone']}
<p><strong>Phone number</strong>: {$_pls['phone']}</p>
{/if}
<p><strong>Email</strong>: <a href="mailto:{$_pls['email']}">{$_pls['email']}</a></p>
{if $_pls['message']}
<p><strong>Message</strong>: {$_pls['message']}</p>
{/if}
Konstantin
11 января 2024, 11:32
modx.pro
405
0

Комментарии: 1

Наумов Алексей
11 января 2024, 13:15
0
Ну вот тут было бы логично добавить проверку isset или array_key_exists. это скорее косяк компонента.

github.com/GulomovCreative/FetchIt/blob/master/core/components/fetchit/model/fetchit.class.php#L79
    Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
    1