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

カスタムユニットがロード時にアンシリアライズされ、エラーが表示される問題 #15

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

1000-x-t30
Copy link
Contributor

No description provided.

@1000-x-t30 1000-x-t30 self-assigned this Nov 28, 2024
@@ -154,7 +154,7 @@ public function load($item)
foreach ($this->units as & $unit) {
$type = detectUnitTypeSpecifier($unit->getType());
if ($type === 'custom') {
$unit->setField6(acmsUnserialize($unit->getField6()));
$unit->setField6($unit->getField6());
}
Copy link
Contributor

@uidev1116 uidev1116 Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1000-x-t30
$unit の field6 の値を $unit の field6 で上書きしてるので、setField6 する前と後で何も変わってないということですかね?
となると、そもそも if ($type === 'custom') { ... } まで不要なのでは?と思うのですがどうでしょうか?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

columnテーブルにはフィールド情報もっていないので、翻訳するには専用の処理が必要だと思われます。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$unit->getCustomUnitField() でフィールドが取得できるのかな。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atsu666 @1000-x-t30
$unit->getCustomUnitField() が生えるのは 3.2 からなので、現状はカスタムユニットの翻訳は未対応ということでいいのかなと思ってます。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atsu666 @uidev1116
ご指摘ありがとうございます。
現状はカスタムユニットの翻訳未対応で、アンシリアライズする必要がなく内容の変化がないので条件ごと削除しました。
ご確認お願いいたします。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

承認します。

Copy link
Contributor

@uidev1116 uidev1116 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

お疲れ様です!

@atsu666 atsu666 merged commit effa03d into master Nov 28, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants