Pimcoreエラー対応

Server 500 Error

試験サーバ上でPimcore6へアップデート後、ファイル一式とsqlデータをGCEへ移行。
フロントエンド画面で500エラー発生(ブランクページ)。

<原因>
PimcoreのData Objects作成時、データベースinformation_schemeのテーブルVIEWSDEFINER(‘user_name’@‘host_name’)が設定されるが、このDEFINERが移行先データベースのDEFINERと一致しないため。

<対策>
Pimcore管理画面でSettings->Data Objects->Clases内の各クラスを呼び出して再保存することで、移行先データベースのユーザにDEFINERが書換えられます。

<参考>

DEFINERSQLコマンドで直接書き換える場合は以下参照願います。

モバイル画面でのイメージリサイズエラー

モバイル画面上でもイメージのリサイズが実行されないため、/app/Resources/views/Areas/wysiwyg/view.html.php
ファイル内で定義しているsectionタグ追加。

headlinesエリアブロックのphpファイル
/app/Resources/views/Areas/headlines/view.html.php

のリンク先ファイル
/app/Resources/views/Includes/area-headlines.html.php

sectionタグ追加

<section class="lead">

<?php if ($this->editmode || !$this->input("headline")->isEmpty()) { ?>
    <div class="page-header">
        <h2><?= $this->input("headline"); ?></h2>
    </div>
<?php } ?>


<?php if ($this->editmode || !$this->wysiwyg("lead")->isEmpty()) { ?>
    <div class="lead">
        <?= $this->wysiwyg("lead", ["height" => 100]); ?>
    </div>
<?php } ?>

</secton>

WYSIWYG Editable

改行エラー

ブログコンテンツの英字表記箇所の改行エラー
bootstrap.css

word-break: break-all;

を以下ブロックに追加。

.....
b,
strong {
  font-weight: bold;
  word-break: break-all;
}
.....
.....
p {
  margin: 0 0 10.5px;
  word-break: break-all;
}
.....

v10.xからv11への移行の際に発生したエラーとその対応

アップグレードする前準備

アップグレードする前準備として、管理画面で設定する以下項目については確実に引継がれるようデータデースへの保存settings-storeとすること。この設定は、v11では.envからconfig.yamlへの記述へと変更となります。settings-storeへ確実に保存するため再度各設定を保存またはアップデートすること(データベースのテーブル:settings_storeで確認すること)。

.env 以下の内容を全て削除

PIMCORE_WRITE_TARGET_IMAGE_THUMBNAILS=settings-store
PIMCORE_WRITE_TARGET_CUSTOM_REPORTS=settings-store
PIMCORE_WRITE_TARGET_VIDEO_THUMBNAILS=settings-store
PIMCORE_WRITE_TARGET_DOCUMENT_TYPES=settings-store
PIMCORE_WRITE_TARGET_PREDEFINED_PROPERTIES=settings-store
PIMCORE_WRITE_TARGET_PREDEFINED_ASSET_METADATA=settings-store
PIMCORE_WRITE_TARGET_STATICROUTES=settings-store

config.yaml 以下の形式で記述

pimcore:
    config_location:
        image_thumbnails:
            write_target:
                type: 'settings-store'
        video_thumbnails:
            write_target:
                type: 'settings-store'
        document_types:
            write_target:
                type: 'settings-store'
        predefined_properties:
            write_target:
                type: 'settings-store'
        predefined_asset_metadata:
            write_target:
                type: 'settings-store'
        perspectives:
            write_target:
                type: 'settings-store'
        custom_views:
            write_target:
                type: 'settings-store'
        object_custom_layouts:
            write_target:
                type: 'settings-store'

Migrationエラー


# bin/console doctrine:migrations:migrate

 WARNING! You are about to execute a migration in database "pimcore10" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
 > 

                                                                                                                        
 [WARNING] You have 2 previously executed migrations in the database that are not registered migrations.                
                                                                                                                        

 >>  (Pimcore\Bundle\CoreBundle\Migrations\Version20210430124911)
 >> 2023-06-18 03:52:41 (Pimcore\Bundle\CoreBundle\Migrations\Version20230307135459)

 Are you sure you wish to continue? (yes/no) [yes]:
 > 

[notice] Migrating up to Pimcore\Bundle\CoreBundle\Migrations\Version22020614115124
[error] Migration Pimcore\Bundle\CoreBundle\Migrations\Version20230424084415 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`pimcore10`.`documents_editables`, CONSTRAINT `fk_documents_editables_documents` FOREIGN KEY (`documentId`) REFERENCES `documents` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION)"

.........
.........

既にfk_documents_editables_documentsという制約条件がテーブルdocuments_editablesに定義されていたことが原因のエラー。phpMyAdmin上で、この制約条件をテーブルdocuments_editablesのリレーションビューから削除。


[Definition Files] Make sure your definition files in var/classes are up-to-date and all default values are set correctly by running following migration:

bin/console doctrine:migration:exec ‘Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105’

エラー内容

# bin/console doctrine:migration:exec 'Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105'

 WARNING! You are about to execute a migration in database "pimcore10" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
 > 

[notice] Executing Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105 up
[notice] Saving class: BlogCategory
[notice] Saving class: Blog
[notice] Saving class: News
[notice] Saving field collection: BlogLinks
[notice] Saving field collection: BlogText
[notice] Saving field collection: NewsLinks
[notice] Saving field collection: NewsText
[warning] Migration Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105 was executed but did not result in any SQL statements.
[error] Migration Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105 failed during Post-Checks. Error: "An exception occurred while executing 'INSERT INTO migration_versions (`version`, `executed_at`, `execution_time`) VALUES (?, ?, ?)' with params ["Pimcore\\Bundle\\CoreBundle\\Migrations\\Version20230508121105", "2023-06-20 12:10:17", 518]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105' for key 'PRIMARY'"
12:10:18 CRITICAL  [console] Error thrown while running command "'doctrine:migration:exec' 'Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105'". Message: "An exception occurred while executing 'INSERT INTO migration_versions (`version`, `executed_at`, `execution_time`) VALUES (?, ?, ?)' with params ["Pimcore\\Bundle\\CoreBundle\\Migrations\\Version20230508121105", "2023-06-20 12:10:17", 518]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105' for key 'PRIMARY'" ["exception" => Doctrine\DBAL\Exception\UniqueConstraintViolationException^ { …},"command" => "'doctrine:migration:exec' 'Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105'","message" => """  An exception occurred while executing 'INSERT INTO migration_versions (`version`, `executed_at`, `execution_time`) VALUES (?, ?, ?)' with params ["Pimcore\\Bundle\\CoreBundle\\Migrations\\Version20230508121105", "2023-06-20 12:10:17", 518]:\n  \n  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Pimcore\Bundle\CoreBundle\Migrations\Version20230508121105' for key 'PRIMARY'  """]

In AbstractMySQLDriver.php line 74:
                                                                                                                                 
  An exception occurred while executing 'INSERT INTO migration_versions (`version`, `executed_at`, `execution_time`) VALUES (?,  
   ?, ?)' with params ["Pimcore\\Bundle\\CoreBundle\\Migrations\\Version20230508121105", "2023-06-20 12:10:17", 518]:            
                                                                                                                                 
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Pimcore\Bundle\CoreBundle\Migrations\Version2023050812  
  1105' for key 'PRIMARY'                                                                                                        
                                                                                                                                 

In Exception.php line 18:
                                                                                                                                 
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Pimcore\Bundle\CoreBundle\Migrations\Version2023050812  
  1105' for key 'PRIMARY'                                                                                                        
                                                                                                                                 

In PDOStatement.php line 117:
                                                                                                                                 
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Pimcore\Bundle\CoreBundle\Migrations\Version2023050812  
  1105' for key 'PRIMARY'                                                                                                        
                                                                                                                                 

doctrine:migrations:execute [--write-sql [WRITE-SQL]] [--dry-run] [--up] [--down] [--query-time] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--prefix [PREFIX]] [--] <versions>.

テーブルmigration_versionsに既に登録されていたため削除して再実行(これはv10.6へのアップデート時に既に登録されていたためエラーはスルーして可)。


MariaDBエラー

mariadb  | 2023-06-22 22:19:03 4 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).
mariadb  | 2023-06-22 22:19:03 4 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').

Docker Composeファイルの環境変数に- MARIADB_AUTO_UPGRADE=1を追加。

$ docker-compose exec mariadb mysql_upgrade ---user=USER --password=PASSWORD

bin/console pimcore:bundle:install PimcoreAdminBundle エラー

root@1c2aea9fb5e6:/var/www/html/pimcore10# bin/console pimcore:bundle:list
+----------------------------------+---------+-----------+-------------+---------------+----------+
| Bundle                           | Enabled | Installed | Installable | Uninstallable | Priority |
+----------------------------------+---------+-----------+-------------+---------------+----------+
| PimcoreAdminBundle               | ✔       | ❌        | ✔           | ❌            | 0        |
| PimcoreApplicationLoggerBundle   | ✔       | ✔         | ❌          | ✔             | 0        |
| PimcoreCustomReportsBundle       | ✔       | ✔         | ❌          | ✔             | 0        |
| PimcoreGlossaryBundle            | ✔       | ✔         | ❌          | ✔             | 0        |
| PimcoreSeoBundle                 | ✔       | ✔         | ❌          | ✔             | 0        |
| PimcoreSimpleBackendSearchBundle | ✔       | ❌        | ✔           | ❌            | 0        |
| PimcoreStaticRoutesBundle        | ✔       | ✔         | ❌          | ✔             | 0        |
| PimcoreTinymceBundle             | ✔       | ✔         | ❌          | ✔             | 0        |
| PimcoreUuidBundle                | ❌      | ❌        | ❌          | ❌            | 0        |
| PimcoreWordExportBundle          | ✔       | ✔         | ❌          | ✔             | 0        |
| PimcoreXliffBundle               | ✔       | ✔         | ❌          | ✔             | 0        |
+----------------------------------+---------+-----------+-------------+---------------+----------+

Legend: I?: Can be installed? UI?: Can be uninstalled? UP?: Can be updated?
root@1c2aea9fb5e6:/var/www/html/pimcore10# bin/console pimcore:bundle:install PimcoreAdminBundle

                                                                                                                   
 [ERROR] An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062      
         Duplicate entry 'admin_translations' for key 'PRIMARY'                                                    
                                                                                                                   

root@1c2aea9fb5e6:/var/www/html/pimcore10# bin/console pimcore:bundle:install PimcoreAdminBundle

                                                                                                                   
 [ERROR] An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062      
         Duplicate entry 'gdpr_data_extractor' for key 'PRIMARY'                                                   
                                                                                                                   

root@1c2aea9fb5e6:/var/www/html/pimcore10# bin/console pimcore:bundle:install PimcoreAdminBundle

                                                                                                                   
 [ERROR] An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062      
         Duplicate entry 'admin_translations' for key 'PRIMARY'                                                    
                                                                                                                   

root@1c2aea9fb5e6:/var/www/html/pimcore10# bin/console pimcore:bundle:install PimcoreAdminBundle

                                                                                                                   
 [ERROR] An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062      
         Duplicate entry 'system_appearance_settings' for key 'PRIMARY'                                            
                                                                                                                   

テーブルusers_permission_definitionsの項目削除

  • ‘admin_translations’
  • ‘gdpr_data_extractor’
  • ‘system_appearance_settings’

System Settings, Appearance Brandingの設定

:bangbang: 移行後に以下の設定の読込みと保存が出来ない不具合

System Settings

Appearance Branding

以下の作業が必要:config/config.yaml

  • read_targetセクションをコメントアウト
  • キャッシュをクリアbin/console cache:clearし読込みを無効化
  • System Settings, Appearance Brandingにアクセスし設定を保存
  • read_targetセクションをアンコメント
  • 再びキャッシュをクリアbin/console cache:clearし読込みと保存を有効化

config/config.yaml

pimcore:
    system_settings:
        write_target:
            type: 'settings-store'
        read_target:
            type: 'settings-store'

#### Pimcore ADMIN
pimcore_admin:
    admin_csp_header:
        enabled: false
        exclude_paths:
            - '@^/admin/external_opcache@'
    config_location:
        admin_system_settings:
            write_target:
                type: 'settings-store'
            read_target:
                type: 'settings-store'

言語スイッチエラー

選択した言語表示に切り換わらない。
PHPコードのバグ。if条件の再定義。

新)言語切替のリンクがリストアップしたページ毎に反映されない。

if ($routeParams['newstitle'] || $routeParams['blogtitle']) {
                $routeParams['_locale'] = \Locale::getPrimaryLanguage($language);
                $route = $this->urlGenerator->generate($route, $routeParams);
                $target = $route;
            }

エディターCKEditorからTinyMCEへ移行:表示エラー

Symfony HTML Sanitizer による表示制限が原因。Sanitizerによりデフォルトの表示エレメントが以下のように制限されているため、コード、画像、表示文字などの指定外のエレメントが非表示となってしまう。

vendor/pimcore/pimcore/bundles/CoreBundle/config/pimcore/default.yaml

framework:
    html_sanitizer:
        sanitizers:
            pimcore.wysiwyg_sanitizer:
                allow_elements:
                    span : [ 'class', 'style', 'id' ]
                    div : [ 'class', 'style', 'id' ]
                    p: [ 'class', 'style', 'id' ]
                    strong: 'class'
                    em: 'class'
                    h1: ['class', 'id']
                    a: ['class', 'id', 'href', 'target', 'title', 'rel']
                    table: ['class', 'style', 'cellspacing', 'cellpadding', 'border', 'width', 'height', 'id']
                    colgroup: 'class'
                    col: ['class', 'style', 'id']
                    tbody: ['class', 'id']
                    tr: ['class', 'id']
                    td: ['class', 'id']
                    ul: ['class', 'style', 'id']
                    li: ['class', 'style', 'id']
                    ol: ['class', 'style', 'id']
            pimcore.translation_sanitizer:
                allow_elements:
                    span: [ 'class', 'style', 'id' ]
                    p: [ 'class', 'style', 'id' ]
                    strong: 'class'
                    em: 'class'
                    h1: [ 'class', 'id' ]
                    h2: [ 'class', 'id' ]
                    h3: [ 'class', 'id' ]
                    h4: [ 'class', 'id' ]
                    h5: [ 'class', 'id' ]
                    h6: [ 'class', 'id' ]
                    a: [ 'class', 'id', 'href', 'target', 'title', 'rel' ]

以下のファイルを作成し設定を上書き
(暫定策、 HTML Sanitizer API を参照し細かく指定したほうが良い)。

config/packages/html_sanitizer.yaml

framework:
    html_sanitizer:
        sanitizers:
            app.post_sanitizer:
                # enable either of these
                # allow_safe_elements: true
                allow_static_elements: true

管理画面500エラー

”exception error" ダイアログが表示され設定の保存などが出来ない。

以下データベースへのデータ移行で解決。

# bin/console doctrine:migrations:migrate

サイトマップライブラリ変更

config/routes/presta_sitemap.yaml

presta_sitemap:
    resource: "@PrestaSitemapBundle/config/routing.yml"

SeoBundle, SitemapBundle を追加
config/bundles.php

<?php

.....
.....
use Pimcore\Bundle\SeoBundle\PimcoreSeoBundle;
.....
.....
use Presta\SitemapBundle\PrestaSitemapBundle;
.....

return [
    .....
    .....
    PimcoreSeoBundle::class => ['all' => true],
    .....
    .....
    PrestaSitemapBundle::class => ['all' => true],
    .....
    .....
];

英文ページ表示エラー

ページの保存・削除も不可。

エラーログ
var/log/prod.log

[2023-07-07T07:28:08.928544+00:00] php.CRITICAL: Uncaught Error: Pimcore\Twig\Extension\Templating\Inc::__invoke(): Argument #1 ($include) must be of type Pimcore\Model\Document\PageSnippet|string|int, null given, called in /var/www/html/pimcore10/var/cache/prod/twig/02/02420062707554a538d97f75b202bbd5.php on line 442 {"exception":"[object] (TypeError(code: 0): Pimcore\\Twig\\Extension\\Templating\\Inc::__invoke(): Argument #1 ($include) must be of type Pimcore\\Model\\Document\\PageSnippet|string|int, null given, called in /var/www/html/pimcore10/var/cache/prod/twig/02/02420062707554a538d97f75b202bbd5.php on line 442 at /var/www/html/pimcore10/vendor/pimcore/pimcore/lib/Twig/Extension/Templating/Inc.php:47)"} []
[2023-07-07T07:28:08.930727+00:00] php.CRITICAL: Uncaught Exception: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundException(code: 1146): An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist at /var/www/html/pimcore10/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:49)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1146): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist at /var/www/html/pimcore10/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist at /var/www/html/pimcore10/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:121)"} []

原因:サイドバー(スニペット)の設定がされていなかったことによるエラー

対応:以下サイドバースニペットを表示エラーページに追加してページを保存。


管理画面ダイアログ

Timestamp: Fri Jul 07 2023 20:46:40 GMT+0900 (日本標準時)
Status: 500 | Internal Server Error
URL: /admin/page/get-data-by-id
Message: Cannot assign null to property Pimcore\Model\Document\Editable::$realName of type string

エラーログ
var/log/prod.log

[2023-07-07T11:42:36.201380+00:00] php.CRITICAL: Uncaught Error: Cannot assign null to property Pimcore\Model\Document\Editable::$realName of type string {"exception":"[object] (TypeError(code: 0): Cannot assign null to property Pimcore\\Model\\Document\\Editable::$realName of type string at /var/www/html/pimcore10/vendor/pimcore/pimcore/lib/Tool/Serialize.php:31)"} []
[2023-07-07T11:42:36.204626+00:00] request.CRITICAL: Uncaught PHP Exception TypeError: "Cannot assign null to property Pimcore\Model\Document\Editable::$realName of type string" at /var/www/html/pimcore10/vendor/pimcore/pimcore/lib/Tool/Serialize.php line 31 {"exception":"[object] (TypeError(code: 0): Cannot assign null to property Pimcore\\Model\\Document\\Editable::$realName of type string at /var/www/html/pimcore10/vendor/pimcore/pimcore/lib/Tool/Serialize.php:31)"} []

対応:ドキュメントアイコンを一度ドラッグアンドドロップして別の場所へ移動することでファイル階層を再構築

[2023-07-08T08:35:31.588820+00:00] php.CRITICAL: Uncaught Exception: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundException(code: 1146): An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist at /var/www/html/pimcore10/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:49)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1146): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist at /var/www/html/pimcore10/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pimcore10.http_error_log' doesn't exist at /var/www/html/pimcore10/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:121)"} []

対応:下記テーブル作成
vendor/pimcore/pimcore/bundles/SeoBundle/src/Resources/install/install.sql

CREATE TABLE IF NOT EXISTS `http_error_log` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `uri` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
    `code` int(3) DEFAULT NULL,
    `parametersGet` longtext,
    `parametersPost` longtext,
    `cookies` longtext,
    `serverVars` longtext,
    `date` int(11) unsigned DEFAULT NULL,
    `count` bigint(20) unsigned DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `uri` (`uri`),
    KEY `code` (`code`),
    KEY `date` (`date`),
    KEY `count` (`count`)
) DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

メンテナンススクリプト実行時エラー

# bin/console messenger:consume pimcore_core pimcore_maintenance pimcore_image_optimize pimcore_search_backend_message --time-limit=300

エラーログ
var/log/prod.log

[2023-07-12T08:00:17.514235+00:00] console.CRITICAL: Error thrown while running command "messenger:consume pimcore_core pimcore_maintenance pimcore_image_optimize pimcore_search_backend_message --time-limit=300". Message: "Message class "Pimcore\Messenger\SearchBackendMessage" not found during decoding." {"exception":"[object] (Symfony\\Component\\Messenger\\Exception\\MessageDecodingFailedException(code: 0): Message class \"Pimcore\\Messenger\\SearchBackendMessage\" not found during decoding. at /var/www/html/pimcore10/vendor/symfony/messenger/Transport/Serialization/PhpSerializer.php:117)","command":"messenger:consume pimcore_core pimcore_maintenance pimcore_image_optimize pimcore_search_backend_message --time-limit=300","message":"Message class \"Pimcore\\Messenger\\SearchBackendMessage\" not found during decoding."} []

特殊文字の表示エラー

wysiwyg : &lt; = ‘<’ サニタイズにより非表示

Symfonyのサニタイズエラー:fixed

以下ファイル内で

models/DataObject/ClassDefinition/Data/Wysiwyg.php
models/Document/Editable/Wysiwyg.php

データのデコード処理を削除

修正前

sanitize(html_entity_decode($data));

修正後

sanitize($data);

リスト一覧ページ:&#039; = ‘'’ 不変換

twigによるrawデータからの出力へ変更

templates/blog/listing.html.twig

{{ item.text[:300] | striptags | raw }} .....

ドキュメント保存時のエラー

lib/Tool/Text.php

if (count($matches[2]) > 0) {
            for ($i = 0; $i < count($matches[2]); $i++) {
                preg_match('/[0-9]+/', $matches[2][$i], $idMatches);
                preg_match('/asset|object|document/', $matches[3][$i], $typeMatches);

                if (isset($idMatches[0], $typeMatches[0])) {
                    $elements[] = [
                        'id' => (int) $idMatches[0],
                        'type' => $typeMatches[0],
                    ];
                }
            }
        }

アセット画像リンクエラー

アセットからTynyMCEによるテキストエリアへドラッグ&ドロップした画像のリンクエラー

関連ファイル

public/bundles/pimcoretinymce/js/editor.js

if (data.elementType === "asset") {
            if (data.type === "image" && textIsSelected === false) {
                // images bigger than 600px or formats which cannot be displayed by the browser directly will be
                // converted by the pimcore thumbnailing service so that they can be displayed in the editor
                let defaultWidth = 600;
                let additionalAttributes = {};

                if (typeof data.imageWidth != "undefined") {
                    const route = 'pimcore_admin_asset_getimagethumbnail';
                    const params = {
                        id: id,
                        width: defaultWidth,
                        aspectratio: true
                    };

                    uri = Routing.generate(route, params);

                    if (data.imageWidth < defaultWidth
                        && in_arrayi(pimcore.helpers.getFileExtension(data.text),
                            browserPossibleExtensions)) {
                        uri = data.path;
                        additionalAttributes = mergeObject(additionalAttributes, {pimcore_disable_thumbnail: true});
                    }

                    if (data.imageWidth < defaultWidth) {
                        defaultWidth = data.imageWidth;
                    }

                    additionalAttributes = mergeObject(additionalAttributes, {style: `width:${defaultWidth}px;`});
                }

                additionalAttributes = mergeObject(additionalAttributes, {
                    src: uri,
                    pimcore_type: 'asset',
                    pimcore_id: id,
                    target: '_blank',
                    alt: 'asset_image'
                });
                tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('img', additionalAttributes));
                return true;
            } else {
                tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {
                    href: uri,
                    pimcore_type: 'asset',
                    pimcore_id: id,
                    target: '_blank'
                }, wrappedText));
                return true;
            }
        }

vendor/pimcore/admin-ui-classic-bundle/src/Controller/Admin/Asset/AssetController.php

.....
.....
/**
     * @Route("/get-image-thumbnail", name="pimcore_admin_asset_getimagethumbnail", methods={"GET"})
     *
     * @param Request $request
     *
     * @return StreamedResponse|JsonResponse|BinaryFileResponse
     */
    public function getImageThumbnailAction(Request $request): BinaryFileResponse|JsonResponse|StreamedResponse
    {
        $fileinfo = $request->get('fileinfo');
        $image = Asset\Image::getById((int)$request->get('id'));
.....
.....

原因:

以下PHPファイル内での項目別正規表現での条件順序が、スクリプトの項目順序と異なっていたため。

pimcore/lib/Tool/Text.php

Line 194 in 8378d75

preg_match_all(“@<(a img)[^>](pimcore_id="[0-9]+")[^>](pimcore_type="[asset document object]+")[^>]*>@msUi”, $text, $matches);

bundles/TinymceBundle/public/js/editor.js

additionalAttributes = mergeObject(additionalAttributes, {
                    src: uri,
                    target: '_blank',
                    alt: 'asset_image',
                    pimcore_id: id,
                    pimcore_type: 'asset'
                });
.....
.....
tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {
                    href: uri,
                    target: '_blank',
                    pimcore_id: id,
                    pimcore_type: 'asset'
                }, wrappedText));
.....
.....
tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {
                href: uri,
                pimcore_id: id,
                pimcore_type: 'document'
            }, wrappedText));
.....
.....
if (data.elementType === "object") {
            tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {
                href: uri,
                pimcore_id: id,
                pimcore_type: 'object'
            }, wrappedText));
.....
.....

上記対策は11.0.9にマージ