# Pimcoreエラー対応

**URL:** https://forum.ficusonline.com/t/topic/331
**Category:** WEB Design
**Created:** [2019 年 10 月 25 日午前 10:13 UTC](https://forum.ficusonline.com/t/topic/331 "2019-10-25T10:13:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2019 年 10 月 25 日午前 10:13 UTC](https://forum.ficusonline.com/t/topic/331/1 "2019-10-25T10:13:17Z")

</div>

> **[pimcore/pimcore](https://github.com/pimcore/pimcore/issues)**
>
> Core Framework for the Open Core Data & Experience Management Platform (PIM, MDM, CDP, DAM, DXP/CMS & Digital Commerce) - pimcore/pimcore

### Server 500 Error

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

**\<原因\>**  
Pimcoreの **Data Objects** 作成時、データベース **information\_scheme** のテーブル **VIEWS** に **DEFINER** (‘user\_name’@‘host\_name’)が設定されるが、この **DEFINER** が移行先データベースの **DEFINER** と一致しないため。

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

**\<参考\>**

> <https://stackoverflow.com/questions/27854264/fatal-error-when-moving-pimcore-from-a-server-to-local>

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

> <https://stackoverflow.com/questions/10169960/mysql-error-1449-the-user-specified-as-a-definer-does-not-exist>

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2020 年 7 月 12 日午後 2:33 UTC](https://forum.ficusonline.com/t/topic/331/2 "2020-07-12T14:33:42Z")

</div>

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

モバイル画面上でもイメージのリサイズが実行されないため、 **/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タグ** 追加

```php
<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

[https://pimcore.com/docs/6.x/Development\_Documentation/Documents/Editables/WYSIWYG.html#page\_WYSIWYG-Editable](https://pimcore.com/docs/6.x/Development_Documentation/Documents/Editables/WYSIWYG.html#page_WYSIWYG-Editable)

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2020 年 7 月 13 日午前 1:42 UTC](https://forum.ficusonline.com/t/topic/331/3 "2020-07-13T01:42:07Z")

</div>

### 改行エラー

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

```auto
word-break: break-all;

```

を以下ブロックに追加。

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

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2023 年 6 月 19 日午後 10:35 UTC](https://forum.ficusonline.com/t/topic/331/4 "2023-06-19T22:35:54Z")

</div>

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

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

[https://pimcore.com/docs/platform/Pimcore/Installation\_and\_Upgrade/Updating\_Pimcore/Preparing\_for\_V11](https://pimcore.com/docs/platform/Pimcore/Installation_and_Upgrade/Updating_Pimcore/Preparing_for_V11)

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

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

```auto
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` 以下の形式で記述

```auto
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エラー

* * *

```yml
# 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’

> <https://github.com/pimcore/pimcore/blob/2026.x/doc/23_Installation_and_Upgrade/07_Updating_Pimcore/11_Preparing_for_V11.md#additional-things-to-consider>

**エラー内容**

```auto
# 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エラー

```auto
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を追加。

> **[How to fix docker MariaDB correct definition of table mysql.column\_stats:...](https://techoverflow.net/2022/06/07/how-to-fix-docker-mariadb-correct-definition-of-table-mysql-column_stats-expected-column-hist_type-at-position-9/)**
>
> Based in Munich, our engineers & laboratory helps you to develop your product from the first idea to certification & production.

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

```

* * *

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

```auto
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の設定

[https://pimcore.com/docs/platform/Pimcore/Tools\_and\_Features/System\_Settings/](https://pimcore.com/docs/platform/Pimcore/Tools_and_Features/System_Settings/)

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

**System Settings**

 ![Screenshot from 2023-06-23 17-46-06](https://forum.ficusonline.com/uploads/default/original/2X/e/e919fc23f8d2f7b83f6e3fee4b1eb7410a084b99.png)

**Appearance Branding**

 ![Screenshot from 2023-06-23 17-45-32](https://forum.ficusonline.com/uploads/default/original/2X/d/d5d929d4682afc086c33d841c79f837f7e7a95f2.png)

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

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

`config/config.yaml`

```auto
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条件の再定義。

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

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

```

[https://github.com/pimcore/demo/issues/517](https://github.com/pimcore/demo/issues/517)

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

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

[https://pimcore.com/docs/platform/Pimcore/Documents/Editables/WYSIWYG/#extending-symfony-html-sanitizer-configuration](https://pimcore.com/docs/platform/Pimcore/Documents/Editables/WYSIWYG/#extending-symfony-html-sanitizer-configuration)

> **[HTML Sanitizer (Symfony Docs)](https://symfony.com/doc/current/html_sanitizer.html)**
>
> The HTML Sanitizer component aims at sanitizing/cleaning untrusted HTML code (e.g. created by a WYSIWYG editor in the browser) into HTML that can be trusted. It is based on the HTML Sanitizer W3C Stan…

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

```auto
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](https://wicg.github.io/sanitizer-api/) を参照し細かく指定したほうが良い）。

`config/packages/html_sanitizer.yaml`

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

```

* * *

### 管理画面500エラー

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

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

```auto
# bin/console doctrine:migrations:migrate

```

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

`config/routes/presta_sitemap.yaml`

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

```

**`SeoBundle, SitemapBundle`** を追加  
`config/bundles.php`

```auto
<?php

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

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

```

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2023 年 7 月 7 日午前 7:37 UTC](https://forum.ficusonline.com/t/topic/331/5 "2023-07-07T07:37:45Z")

</div>

## 英文ページ表示エラー

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

 ![Screenshot from 2023-07-07 16-28-31](https://forum.ficusonline.com/uploads/default/original/2X/f/f053d4cde97af50442b94ad63b493eb8c4e40eaa.png)

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

```auto
[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)"} []

```

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

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

 ![Screenshot from 2023-07-07 16-27-58](https://forum.ficusonline.com/uploads/default/original/2X/9/964a6200051e8b4dc86fd002c022de08a6121804.png)

* * *

**管理画面ダイアログ**

> 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`

```auto
[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)"} []

```

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

```auto
[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`

```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;

```

* * *

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

[https://pimcore.com/docs/platform/Pimcore/Getting\_Started/Installation/Webserver\_Installation#5-maintenance-cron-job](https://pimcore.com/docs/platform/Pimcore/Getting_Started/Installation/Webserver_Installation#5-maintenance-cron-job)

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

```

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

```auto
[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."} []

```

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2023 年 7 月 16 日午前 8:45 UTC](https://forum.ficusonline.com/t/topic/331/6 "2023-07-16T08:45:00Z")

</div>

## 特殊文字の表示エラー

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

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

[https://github.com/pimcore/pimcore/pull/15811/files](https://github.com/pimcore/pimcore/pull/15811/files)

以下ファイル内で

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

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

修正前

```auto
sanitize(html_entity_decode($data));

```

修正後

```auto
sanitize($data);

```

[https://github.com/pimcore/pimcore/issues/15740](https://github.com/pimcore/pimcore/issues/15740)

> **[protect - Content filtering options | TinyMCE Documentation](https://www.tiny.cloud/docs/tinymce/6/content-filtering/#protect)**
>
> This option allows you to specify whether the editor should parse and keep conditional comments. | These settings change the way the editor handles the input and output of content. This will help you to create clean, maintainable and readable...

* * *

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

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

`templates/blog/listing.html.twig`

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

```

* * *

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

[https://github.com/pimcore/pimcore/issues/15652](https://github.com/pimcore/pimcore/issues/15652)

`lib/Tool/Text.php`

```auto
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によるテキストエリアへドラッグ＆ドロップした画像のリンクエラー

[https://github.com/pimcore/pimcore/issues/15874](https://github.com/pimcore/pimcore/issues/15874)

#### 関連ファイル

**`public/bundles/pimcoretinymce/js/editor.js`**

```auto
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`**

```auto
.....
.....
/**
     * @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](https://github.com/pimcore/pimcore/blob/8378d7506654cb5c8bbade9c98ef18e40e3e25a7/lib/Tool/Text.php#L194)

Line 194 in [8378d75](https://github.com/pimcore/pimcore/commit/8378d7506654cb5c8bbade9c98ef18e40e3e25a7)

> preg\_match\_all(“@\<(a img)[^\>]_(pimcore\_id="[0-9]+")[^\>]_(pimcore\_type="[asset document object]+")[^\>]\*\>@msUi”, $text, $matches);

[https://github.com/pimcore/pimcore/pull/15940](https://github.com/pimcore/pimcore/pull/15940)

`bundles/TinymceBundle/public/js/editor.js`

```auto
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にマージ

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2023 年 10 月 29 日午前 2:18 UTC](https://forum.ficusonline.com/t/topic/331/7 "2023-10-29T02:18:32Z")

</div>

11.1.0へのアップデート(`＃ composer update` )の際のエラー

```auto
  An error occurred when executing the "/usr/local/bin/php bin/console --ansi cache:clear --no-warmup --ignore-maintenance-mode" command:  

```

`pimcore/var/cache/*`の削除

[https://github.com/pimcore/pimcore/issues/16161](https://github.com/pimcore/pimcore/issues/16161)
