From c22fbdb9f2498f9c6c0cb9a89c59e144d5ced800 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Tue, 14 Feb 2023 11:04:04 +0100 Subject: [PATCH 01/15] Link::getObject()/setObject() - Trigger deprecations, Add Upgrade note (#14248) * Link::getObject()/setObject() - Trigger deprecations * Add Upgrade Notes for 10.0 --- .../09_Upgrade_Notes/README.md | 1 + models/DataObject/Data/Link.php | 12 ++++++++++++ tests/Model/DataType/BlockTest.php | 6 ++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md b/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md index 814bd5d74c6..99a860cdf4d 100644 --- a/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md +++ b/doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md @@ -335,6 +335,7 @@ framework: - Removed `\Pimcore\Tool::getValidCacheKey/()`, use `preg_replace('/[^a-zA-Z0-9]/', '_', $key)` instead. - Removed `\Pimcore\Tool::isValidPath/()`, use `\Pimcore\Model\Element\Service::isValidPath()` instead. - Deprecated `\Pimcore\Model\Element\Service::getSaveCopyName()`, use `getSafeCopyName()` instead. +- Deprecated methods `getObject()` and `setObject()` on the classes `\Pimcore\Model\Document\Link` and `\Pimcore\Model\DataObject\Data\Link`, use `getElement()` and `setElement()` instead. - Using dynamic modules, controllers and actions in static routes (e.g. `%controller`) does not work anymore. - Removed `\Pimcore\Controller\Config\ConfigNormalizer`. - Removed `pimcore_action()` Twig extension. Use Twig `render()` instead. diff --git a/models/DataObject/Data/Link.php b/models/DataObject/Data/Link.php index 028b0db83ab..48074271897 100644 --- a/models/DataObject/Data/Link.php +++ b/models/DataObject/Data/Link.php @@ -520,6 +520,12 @@ public function setElement($object) */ public function getObject() { + trigger_deprecation( + 'pimcore/pimcore', + '10.0', + 'The Link::getObject() method is deprecated, use Link::getElement() instead.' + ); + return $this->getElement(); } @@ -530,6 +536,12 @@ public function getObject() */ public function setObject($object) { + trigger_deprecation( + 'pimcore/pimcore', + '10.0', + 'The Link::setObject() method is deprecated, use Link::setElement() instead.' + ); + return $this->setElement($object); } diff --git a/tests/Model/DataType/BlockTest.php b/tests/Model/DataType/BlockTest.php index fa17d301306..19026b6b55e 100644 --- a/tests/Model/DataType/BlockTest.php +++ b/tests/Model/DataType/BlockTest.php @@ -147,8 +147,9 @@ public function testReferencesInsideBlock() $loadedData = $object->getTestblock(); + /** @var Link $loadedLink */ $loadedLink = $loadedData[0]['blocklink']->getData(); - $this->assertEquals($targetDocument->getId(), $loadedLink->getObject()->getId()); + $this->assertEquals($targetDocument->getId(), $loadedLink->getElement()->getId()); $loadedHotspotImage = $loadedData[0]['blockhotspotimage']->getData(); $this->assertEquals($asset->getId(), $loadedHotspotImage->getImage()->getId()); @@ -197,8 +198,9 @@ public function testReferencesInsideLocalizedBlock() $object = DataObject::getById($objectRef->getId(), ['force' => true]); $loadedData = $object->getLtestblock('de'); + /** @var Link $loadedLink */ $loadedLink = $loadedData[0]['lblocklink']->getData(); - $this->assertEquals($targetDocument->getId(), $loadedLink->getObject()->getId()); + $this->assertEquals($targetDocument->getId(), $loadedLink->getElement()->getId()); $loadedHotspotImage = $loadedData[0]['lblockhotspotimage']->getData(); $this->assertEquals($asset->getId(), $loadedHotspotImage->getImage()->getId()); From 85efddbfe8088855eb0be26096cee848296efaf8 Mon Sep 17 00:00:00 2001 From: Christoph Maurer Date: Tue, 14 Feb 2023 11:08:38 +0100 Subject: [PATCH 02/15] bugfix update childpaths when changing the parent (#14273) --- models/DataObject/AbstractObject/Dao.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/DataObject/AbstractObject/Dao.php b/models/DataObject/AbstractObject/Dao.php index 88b9d224b68..9afb602792d 100644 --- a/models/DataObject/AbstractObject/Dao.php +++ b/models/DataObject/AbstractObject/Dao.php @@ -162,7 +162,7 @@ public function updateWorkspaces() */ public function updateChildPaths($oldPath) { - if ($this->hasChildren(DataObject::$types)) { + if ($this->hasChildren(DataObject::$types, true)) { //get objects to empty their cache $objects = $this->db->fetchFirstColumn('SELECT o_id FROM objects WHERE o_path LIKE ?', [Helper::escapeLike($oldPath) . '%']); From af39d98f6832283c8f9c1888a512b69da0e22877 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Fri, 10 Feb 2023 11:20:53 +0100 Subject: [PATCH 03/15] Invalidate only given file instead of resetting the whole opcache --- lib/File.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/File.php b/lib/File.php index e89bc19b814..42ca46f6af4 100644 --- a/lib/File.php +++ b/lib/File.php @@ -132,8 +132,8 @@ public static function putPhpFile($path, $data) { $return = self::put($path, $data); - if (function_exists('opcache_reset')) { - opcache_reset(); + if (\function_exists('opcache_invalidate')) { + opcache_invalidate($path); } return $return; From f65720edf0d59a90bb2d149047a11a1724984c73 Mon Sep 17 00:00:00 2001 From: Jan Walther Date: Tue, 14 Feb 2023 13:01:57 +0100 Subject: [PATCH 04/15] show notification during asset update in case uploaded file is too big --- bundles/AdminBundle/Resources/public/js/pimcore/helpers.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/helpers.js b/bundles/AdminBundle/Resources/public/js/pimcore/helpers.js index 1f4ea70752f..d29a765c97b 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/helpers.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/helpers.js @@ -1024,7 +1024,12 @@ pimcore.helpers.uploadDialog = function (url, filename, success, failure, descri iconCls: 'pimcore_icon_upload' }, listeners: { - change: function () { + change: function (fileUploadField) { + if(fileUploadField.fileInputEl.dom.files[0].size > pimcore.settings["upload_max_filesize"]) { + pimcore.helpers.showNotification(t("error"), t("file_is_bigger_that_upload_limit") + " " + fileUploadField.fileInputEl.dom.files[0].name, "error"); + return; + } + uploadForm.getForm().submit({ url: url, params: { From f8f12b2896279a74994e64cb467b7629006b7eb5 Mon Sep 17 00:00:00 2001 From: Aashan Ghimire Date: Tue, 14 Feb 2023 22:25:04 +0545 Subject: [PATCH 05/15] Fixed Voucher paginator issue (#14196) * Fixed paginator issue * Task: apply suggestions * Task: apply change to Single.php * fix: var name is `codes` * task: use $total instead of counting again $tokens * task: apply suggestion Co-authored-by: Divesh Pahuja * Update bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php Co-authored-by: JiaJia Ji * Apply suggestions from code review --------- Co-authored-by: JiaJia Ji Co-authored-by: Divesh Pahuja --- .../VoucherService/TokenManager/Pattern.php | 15 ++++++++++++--- .../VoucherService/TokenManager/Single.php | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php index 9da3d6cb3b4..78a16d4a8b1 100644 --- a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php +++ b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php @@ -541,14 +541,23 @@ public function prepareConfigurationView(&$viewParamsBag, $params) /** @var PaginatorInterface $paginator */ $paginator = \Pimcore::getContainer()->get(\Knp\Component\Pager\PaginatorInterface::class); + + $page = (int)($params['page'] ?? 1); + $perPage = (int)($params['tokensPerPage'] ?? 25); + + $total = count($tokens); + + $availablePages = (int) ceil($total / $perPage); + $page = min($page, $availablePages); + $paginator = $paginator->paginate( $tokens, - $params['page'] ?? 1, - isset($params['tokensPerPage']) ? (int)$params['tokensPerPage'] : 25 + $page ?: 1, + $perPage ); $viewParamsBag['paginator'] = $paginator; - $viewParamsBag['count'] = count($tokens); + $viewParamsBag['count'] = $total; $viewParamsBag['msg']['error'] = $params['error'] ?? null; $viewParamsBag['msg']['success'] = $params['success'] ?? null; diff --git a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Single.php b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Single.php index 67093ca17b3..0e46a21bc82 100644 --- a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Single.php +++ b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Single.php @@ -83,13 +83,22 @@ public function prepareConfigurationView(&$viewParamsBag, $params) if ($codes) { /** @var PaginatorInterface $paginator */ $paginator = \Pimcore::getContainer()->get(\Knp\Component\Pager\PaginatorInterface::class); + + $page = (int)($params['page'] ?? 1); + $perPage = (int)($params['tokensPerPage'] ?? 25); + + $total = count($codes); + + $availablePages = (int) ceil($total / $perPage); + $page = min($page, $availablePages); + $paginator = $paginator->paginate( (array)$codes, - $params['page'] ?? 1, - isset($params['tokensPerPage']) ? (int)$params['tokensPerPage'] : 25 + $page ?: 1, + $perPage ); $viewParamsBag['paginator'] = $paginator; - $viewParamsBag['count'] = count($codes); + $viewParamsBag['count'] = $total; } $viewParamsBag['msg']['error'] = $params['error'] ?? null; From 4bc2492b9bc154dcf0b602f99d3ca04c41e5ba21 Mon Sep 17 00:00:00 2001 From: dvesh3 Date: Tue, 14 Feb 2023 16:41:41 +0000 Subject: [PATCH 06/15] Apply php-cs-fixer changes --- .../VoucherService/TokenManager/Pattern.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php index 78a16d4a8b1..3ff71b10ca0 100644 --- a/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php +++ b/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php @@ -544,9 +544,9 @@ public function prepareConfigurationView(&$viewParamsBag, $params) $page = (int)($params['page'] ?? 1); $perPage = (int)($params['tokensPerPage'] ?? 25); - + $total = count($tokens); - + $availablePages = (int) ceil($total / $perPage); $page = min($page, $availablePages); From db6466ce3aa781206b039e1653d762382af6a680 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Tue, 14 Feb 2023 15:47:48 +0100 Subject: [PATCH 07/15] Fix Error with GeneratePagePreviewMessage, when Page is deleted --- models/Document/Service.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/models/Document/Service.php b/models/Document/Service.php index 61c87826195..51225d4c96c 100644 --- a/models/Document/Service.php +++ b/models/Document/Service.php @@ -650,10 +650,10 @@ public function getNearestDocumentByPath($path, $ignoreHardlinks = false, $types */ public static function generatePagePreview($id, $request = null, $hostUrl = null) { - $success = false; - - /** @var Page $doc */ - $doc = Document::getById($id); + $doc = Document\Page::getById($id); + if (!$doc) { + return false; + } if (!$hostUrl) { $hostUrl = Config::getSystemConfiguration('documents')['preview_url_prefix']; if (empty($hostUrl)) { @@ -684,10 +684,10 @@ public static function generatePagePreview($id, $request = null, $hostUrl = null unlink($tmpFile); - $success = true; + return true; } } - return $success; + return false; } } From 22e100e6f0f8cddc423ce1a8a0981724dd563879 Mon Sep 17 00:00:00 2001 From: dvesh3 Date: Tue, 14 Feb 2023 18:25:04 +0100 Subject: [PATCH 08/15] Fix Glossary not working with partial pimcore_wysiwyg content - resolves #14184 --- lib/Tool/Glossary/Processor.php | 6 +++--- tests/Unit/Document/Glossary/GlossaryTest.php | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Tool/Glossary/Processor.php b/lib/Tool/Glossary/Processor.php index 88507271aed..cccdbafbdd3 100644 --- a/lib/Tool/Glossary/Processor.php +++ b/lib/Tool/Glossary/Processor.php @@ -136,7 +136,7 @@ public function parse(string $content, array $options, string $locale, ?Document $es->each(function ($parentNode, $i) use ($options, $data) { /** @var DomCrawler|null $parentNode */ - $text = htmlentities($parentNode->text(), ENT_XML1); + $text = $parentNode->html(); if ( $parentNode instanceof DomCrawler && !in_array((string)$parentNode->nodeName(), $this->blockedTags) && @@ -158,7 +158,7 @@ public function parse(string $content, array $options, string $locale, ?Document if ($originalText !== $text) { $domNode = $parentNode->getNode(0); $fragment = $domNode->ownerDocument->createDocumentFragment(); - $fragment->appendXML($text); + $fragment->appendXML(htmlentities($text, ENT_XML1)); $clone = $domNode->cloneNode(); $clone->appendChild($fragment); $domNode->parentNode->replaceChild($clone, $domNode); @@ -166,7 +166,7 @@ public function parse(string $content, array $options, string $locale, ?Document } }); - $result = $html->html(); + $result = html_entity_decode($html->html(), ENT_XML1); $html->clear(); unset($html); diff --git a/tests/Unit/Document/Glossary/GlossaryTest.php b/tests/Unit/Document/Glossary/GlossaryTest.php index 4d1349ca260..642b1144767 100644 --- a/tests/Unit/Document/Glossary/GlossaryTest.php +++ b/tests/Unit/Document/Glossary/GlossaryTest.php @@ -50,7 +50,7 @@ public function testGlossary() $expect = '

This is a Test for the Glossary

'; - $this->assertSame($result, $expect); + $this->assertSame($expect, $result); } public function testGlossaryWithHtmlEntities() @@ -71,7 +71,7 @@ public function testGlossaryWithHtmlEntities() $expect = '

This is a Test for the Entity ©

'; - $this->assertSame($result, html_entity_decode($expect)); + $this->assertSame(html_entity_decode($expect), $result); } public function testGlossaryWithHtmlEntities2() @@ -86,7 +86,7 @@ public function testGlossaryWithHtmlEntities2() $expect = '

Test   Eintrag ©

'; - $this->assertSame($result, html_entity_decode($expect)); + $this->assertSame(html_entity_decode($expect), $result); } public function testGlossaryWithHtml() @@ -130,7 +130,7 @@ public function testGlossaryWithHtml() '; - $this->assertSame($result, $expect); + $this->assertSame($expect, $result); } public function testGlossaryWithAnotherHtml() @@ -150,7 +150,7 @@ public function testGlossaryWithAnotherHtml() $expect = '

hans & gretl

'; - $this->assertSame($result, $expect); + $this->assertSame($expect, $result); } public function testGlossaryWithLowerThenAndGreaterThenHtml() @@ -170,6 +170,6 @@ public function testGlossaryWithLowerThenAndGreaterThenHtml() $expect = '

huber <> is the best

'; - $this->assertSame($result, $expect); + $this->assertSame($expect, $result); } } From 37fb021e22b73fb38e248f1eb4f552861209545e Mon Sep 17 00:00:00 2001 From: aryaantony92 Date: Wed, 15 Feb 2023 09:05:47 +0100 Subject: [PATCH 09/15] Fix JS error in video dialog --- .../Resources/public/js/pimcore/object/tags/video.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/video.js b/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/video.js index 88f4f511b62..3e1f56dcd03 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/video.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/video.js @@ -138,12 +138,14 @@ pimcore.object.tags.video = Class.create(pimcore.object.tags.abstract, { openEdit: function () { this.data["path"] = this.data["data"]; this.window = pimcore.helpers.editmode.openVideoEditPanel(this.data, { + save: function () { this.window.hide(); var values = this.window.getComponent("form").getForm().getFieldValues(); values["data"] = values["path"]; delete values["path"]; + values["allowedTypes"] = this.data.allowedTypes; var match, regExp; From 4da4c91736c22f886d81d93112b5e618557c8226 Mon Sep 17 00:00:00 2001 From: Martin Eiber Date: Wed, 15 Feb 2023 13:44:39 +0100 Subject: [PATCH 10/15] fixed priority validation on update. --- .../Resources/public/js/pimcore/settings/redirects.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/settings/redirects.js b/bundles/AdminBundle/Resources/public/js/pimcore/settings/redirects.js index 51fcabe02b6..a5602a26ece 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/settings/redirects.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/settings/redirects.js @@ -550,13 +550,14 @@ pimcore.settings.redirects = Class.create({ this.grid.on("viewready", this.updateRows.bind(this)); this.grid.on('validateedit', function (editor, context) { - if(context["field"] == 'priority' && context['value'] == 99) { + if(context["field"] == 'priority' && context['newValues']['priority'] == 99) { Ext.MessageBox.show({ title: t("warning"), msg: t("redirect_performance_warning"), buttons: Ext.MessageBox.YESNO, fn: function (result) { if (result === 'yes') { + editor.cancelEdit(); context['record'].set('priority', 99); } } From ecc7a7cdd9e71c82d5a034a4e9002a8e8d41b631 Mon Sep 17 00:00:00 2001 From: Niklas Date: Wed, 8 Feb 2023 14:31:13 +0100 Subject: [PATCH 11/15] Adjustments to 03_Assortment_Tenant_Configuration.md --- .../03_Assortment_Tenant_Configuration.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Development_Documentation/10_E-Commerce_Framework/05_Index_Service/01_Product_Index_Configuration/03_Assortment_Tenant_Configuration.md b/doc/Development_Documentation/10_E-Commerce_Framework/05_Index_Service/01_Product_Index_Configuration/03_Assortment_Tenant_Configuration.md index b6810fe90df..b32b9d0a7b4 100644 --- a/doc/Development_Documentation/10_E-Commerce_Framework/05_Index_Service/01_Product_Index_Configuration/03_Assortment_Tenant_Configuration.md +++ b/doc/Development_Documentation/10_E-Commerce_Framework/05_Index_Service/01_Product_Index_Configuration/03_Assortment_Tenant_Configuration.md @@ -13,7 +13,7 @@ The E-Commerce Framework provides a two level Assortment Tenant system for the P One system can have multiple tenants (heavy- and light-weight). But too many tenants can have bad effects on the performance of saving products, since all *Product Indices* need to be updated on every save. -By default the system always uses one heavy-weight tenant (= `DefaultMysql`), but the default tenant can be disabled. +By default the system always uses one heavy-weight tenant (which is `DefaultMysql`), but the default tenant can be disabled. ## Assortment Tenants @@ -40,7 +40,7 @@ attributes. Depending on the *Product Index* implementation, additional configur - **Declare the service:** You need to declare the service as well so the class can be used. On your service configuration or for instance at the top of the ecommerce configuration file: -``` +```yaml services: MyBundle\Service\MySubtenantConfig: calls: @@ -146,7 +146,7 @@ In order to populate the additional mapping data, also following methods have to * * @return mixed $subTenantData */ - public function prepareSubTenantEntries(IIndexable $object, $subObjectId = null); + public function prepareSubTenantEntries(IndexableInterface $object, $subObjectId = null); /** * populates index for tenant relations based on given data @@ -176,7 +176,7 @@ In order to populate the additional mapping data, the following method has to be * * @return array $subTenantData */ - public function prepareSubTenantEntries(IIndexable $object, $subObjectId = null); + public function prepareSubTenantEntries(IndexableInterface $object, $subObjectId = null); ``` From 5c6be2d723f3910689acb09101051b3e14ba6a40 Mon Sep 17 00:00:00 2001 From: Jan Walther Date: Wed, 15 Feb 2023 21:04:16 +0100 Subject: [PATCH 12/15] skip Thumbs.db when importing zip asset --- bundles/AdminBundle/Controller/Admin/Asset/AssetController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/AdminBundle/Controller/Admin/Asset/AssetController.php b/bundles/AdminBundle/Controller/Admin/Asset/AssetController.php index 48ed872b9a6..98ccdb1faa2 100644 --- a/bundles/AdminBundle/Controller/Admin/Asset/AssetController.php +++ b/bundles/AdminBundle/Controller/Admin/Asset/AssetController.php @@ -2347,7 +2347,7 @@ public function importZipFilesAction(Request $request) for ($i = $offset; $i < ($offset + $limit); $i++) { $path = $zip->getNameIndex($i); - if (str_starts_with($path, '__MACOSX/')) { + if (str_starts_with($path, '__MACOSX/') || $path === 'Thumbs.db') { continue; } From bd2669a7fad80f39fb3f51ed93f38780adf26849 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Thu, 16 Feb 2023 14:09:07 +0100 Subject: [PATCH 13/15] Fix: Can't save Objectbrick (#14325) --- models/DataObject/Objectbrick/Definition.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/models/DataObject/Objectbrick/Definition.php b/models/DataObject/Objectbrick/Definition.php index 5ad414c9d98..7b97ad41390 100644 --- a/models/DataObject/Objectbrick/Definition.php +++ b/models/DataObject/Objectbrick/Definition.php @@ -137,13 +137,15 @@ private function checkTablenames() } } - $tablesLen = array_map('strlen', $tables); - array_multisort($tablesLen, $tables); - $longestTablename = end($tables); - - $length = strlen($longestTablename); - if ($length > 64) { - throw new \Exception('table name ' . $longestTablename . ' would be too long. Max length is 64. Current length would be ' . $length . '.'); + if ($tables) { + $tablesLen = array_map('strlen', $tables); + array_multisort($tablesLen, $tables); + $longestTablename = end($tables); + + $length = strlen($longestTablename); + if ($length > 64) { + throw new \Exception('table name ' . $longestTablename . ' would be too long. Max length is 64. Current length would be ' . $length . '.'); + } } } From 4631e44143d45aa94a0a82d3783e883575a6b286 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Thu, 16 Feb 2023 15:41:33 +0100 Subject: [PATCH 14/15] Fix: Web2Print processor type error (#14330) --- lib/Web2Print/Processor/HeadlessChrome.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Web2Print/Processor/HeadlessChrome.php b/lib/Web2Print/Processor/HeadlessChrome.php index 2b69f913fe8..7875f1cc630 100644 --- a/lib/Web2Print/Processor/HeadlessChrome.php +++ b/lib/Web2Print/Processor/HeadlessChrome.php @@ -113,8 +113,8 @@ public function getPdfFromString($html, $params = [], $returnFilePath = false) $converter = new Converter($input, $output); if ($this->nodePath) { $converter->setNodePath($this->nodePath); - } else { - $converter->setNodePath(Console::getExecutable('node')); + } elseif ($nodePath = Console::getExecutable('node')) { + $converter->setNodePath($nodePath); } $converter->setOptions($params); From 517aa4496a5e62b1627ec82200bd80b9f3ae1d71 Mon Sep 17 00:00:00 2001 From: Bernhard Rusch Date: Fri, 17 Feb 2023 11:03:18 +0100 Subject: [PATCH 15/15] Use fixed PhpStan version and create recurring issues for upgrades (#14362) * Use fixed PhpStan version and create recurring issues for upgrades * text * Update monthly-recurring-issues.yml --- .../workflows/monthly-recurring-issues.yml | 25 +++++++++++++++++++ composer.json | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/monthly-recurring-issues.yml diff --git a/.github/workflows/monthly-recurring-issues.yml b/.github/workflows/monthly-recurring-issues.yml new file mode 100644 index 00000000000..d6e9bc44871 --- /dev/null +++ b/.github/workflows/monthly-recurring-issues.yml @@ -0,0 +1,25 @@ +name: Monthly Recurring Issues +on: + workflow_dispatch: + schedule: + - cron: 0 4 1 * * + +jobs: + monthly_recurring_issues: + name: Monthly Recurring Issues + runs-on: ubuntu-latest + steps: + + - name: Get current month + run: echo "MONTH=$(date '+%B')" >> $GITHUB_ENV + + - name: PhpStan Version Upgrade + uses: imjohnbo/issue-bot@v3 + with: + labels: "Task" + title: PhpStan Version Upgrade ${{ env.MONTH }} + body: |- + Please check for a newer PhpStan version. + Create a PR with the latest version and fix all occurring issues :-) + project-v2-path: orgs/pimcore/projects/10 + token: ${{ secrets.ISSUE_CREATION_TOKEN }} diff --git a/composer.json b/composer.json index 2b4c0fac5db..44f567c02a0 100644 --- a/composer.json +++ b/composer.json @@ -173,7 +173,7 @@ "codeception/codeception": "^4.1.12", "codeception/module-symfony": "^1.6.0", "codeception/phpunit-wrapper": "^9", - "phpstan/phpstan": "^1.9.5", + "phpstan/phpstan": "1.9.17", "phpstan/phpstan-symfony": "^1.2.19", "phpunit/phpunit": "^9.3", "spiritix/php-chrome-html2pdf": "^1.6",