※Modx自体もエラーで止まり、最新版(1.0.25J )にアップデートしました。
症状としては、テキスト項目の場合にはエラー(送信エラー)を出しませんが、フィル添付をするとエラーが出ます。
■環境
ホスティング:バリューサーバー
サーバー環境:
Apache 2.4
Perl 5.26.3
PHP 7.4.25
RUBY 3.0.2p107
MySQL 10.6.4-MariaDB
PostgreSQL 14.0
Python 3.6.8
SQLite3 3.26.0
SQLite 3.26.0
■使用している送信フォーム
=================以下フォーム内容=================
<p class="error">[+validationmessage+]</p>
<form method="post" action="[~[*id*]~]" enctype="multipart/form-data">
<fieldset>
<div class="form-group form-inline">
<label for="会社名">会社名</label>
<input name="会社名" class="text form-control" type="text" eform="会社名:string:1" />
</div>
<div class="form-group form-inline">
<label for="email">メールアドレス</label>
<input name="email" class="text form-control" type="text" eform="メールアドレス
</div>
<dl class="file-upload">
<dt>書類1</dt><dd><input type="file" name="書類1" id="cfPhoto1" eform="書類1:file:1" /></dd>
<dt>書類2</dt><dd><input type="file" name="書類2" id="cfPhoto2" eform="書類2:file:1" /></dd>
<dt>書類3</dt><dd><input type="file" name="書類3" id="cfPhoto3" eform="書類3:file:1" /></dd>
<dt>書類4</dt><dd><input type="file" name="書類4" id="cfPhoto4" eform="書類4:file:1" /></dd>
<dt>書類5</dt><dd><input type="file" name="書類5" id="cfPhoto4" eform="書類5:file:1" /></dd>
</dl>
<div class="send-button">
<input type="submit" name="contact" class="btn btn-primary" value="送信" />
</div>
</fieldset>
</form>
=================以上フォーム内容=================
■表示されるエラーメッセージ(ファイル添付時のみ表示)
=================以下はエラーメッセージの内容=================
« MODX Parse Error »
MODX encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error : count(): Parameter must be an array or an object that implements Countable
ErrorType[num] : WARNING[2]
File : /virtual/********/assets/snippets/eform/eform.inc.php
Line : 357
Source : $attachments[count($attachments)] = $_FILES[$name]['tmp_name'];
LastQuery : SELECT id,alias,isfolder,parent FROM `********`.`ha_modx_site_content` WHERE `parent` = "0"
Basic info
REQUEST_URI : /********.html
Resource : [11]********
Current Snippet : eForm
Referer : http://********.html
User Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15
IP : ********
Benchmarks
MySQL : 0.0006 s (12 Requests)
PHP : 0.0067 s
Total : 0.0073 s
Memory : 523.63 KB
Backtrace
1 $modx->executeParser()
index.php on line 94
2 $modx->prepareResponse()
manager/includes/document.parser.class.inc.php on line 319
3 $modx->parseDocumentSource()
manager/includes/document.parser.class.inc.php on line 601
4 $modx->evalSnippets()
manager/includes/document.parser.class.inc.php on line 3287
5 $modx->_get_snip_result()
manager/includes/document.parser.class.inc.php on line 2708
6 $modx->evalSnippet()
manager/includes/document.parser.class.inc.php on line 2796
7 eval()
manager/includes/document.parser.class.inc.php on line 2619
8 eForm()
manager/includes/document.parser.class.inc.php(2619) : eval()'d code on line 22
=================以上はエラーメッセージの内容=================
eformを以前のように使うにはどこを修正すれば良いでしょうか?
それともバージョンアップを待つほうが良いでしょうか?
システム関係に疎いもので、お教えいただければ幸いです。