Skip to content

Instantly share code, notes, and snippets.

Avatar
🔌

Timon de Groot tdgroot

🔌
View GitHub Profile
View MAGENTO_26621.patch
--- a/Block/Product/ProductsList.php
+++ b/Block/Product/ProductsList.php
@@ -8,6 +8,7 @@
use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Block\Product\AbstractProduct;
+use Magento\Catalog\Block\Product\Context;
use Magento\Catalog\Block\Product\Widget\Html\Pager;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Visibility;
@tdgroot
tdgroot / fix_varnish_missing_topmenu_github_3421.patch
Created Jun 10, 2020
Apply using cweagans/composer-patches, patch it for package magento/module-theme!
View fix_varnish_missing_topmenu_github_3421.patch
--- view/frontend/layout/default.orig.xml 2020-06-10 09:03:29.889000000 +0200
+++ view/frontend/layout/default.xml 2020-06-10 09:03:36.624645526 +0200
@@ -70,7 +70,7 @@
<arguments>
<argument name="title" translate="true" xsi:type="string">Menu</argument>
</arguments>
- <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" ttl="3600" before="-"/>
+ <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" before="-"/>
</block>
<block class="Magento\Framework\View\Element\Text" name="store.links" group="navigation-sections">
View MC29999_TelephoneOptionalRequired.patch
--- Model/Config.php 2020-04-23 08:56:42.000000000 +0200
+++ Model/Config.php 2020-05-15 16:28:16.337488649 +0200
@@ -822,6 +822,10 @@
$fullAttributeData = array_key_exists('is_required', $attributeData);
if ($existsFullAttribute || (!$existsFullAttribute && !$fullAttributeData)) {
+ $scopeIsRequired = $attributeData['scope_is_required'] ?? null;
+ if ($scopeIsRequired !== null) {
+ $attribute->setData('scope_is_required', $scopeIsRequired);
+ }
@tdgroot
tdgroot / catalog_graphql_image_size.patch
Created Apr 10, 2020
Add size to Magento_CatalogGraphQl MediaGallery Url field
View catalog_graphql_image_size.patch
--- etc/schema.orig.graphqls 2020-01-10 06:20:38.000000000 +0100
+++ etc/schema.graphqls 2020-04-10 18:07:05.630098596 +0200
@@ -197,7 +197,7 @@
}
interface MediaGalleryInterface @doc(description: "Contains basic information about a product image or video.") @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\MediaGalleryTypeResolver") {
- url: String @doc(description: "The URL of the product image or video.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery\\Url")
+ url(width: Int, height: Int): String @doc(description: "The URL of the product image or video.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery\\Url")
label: String @doc(description: "The label of the product image or video.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery\\Label")
}
@tdgroot
tdgroot / MAGENTO_27311.patch
Created Mar 17, 2020
Magento 2.3 patch for pull request magento/magento#27311
View MAGENTO_27311.patch
--- view/base/web/js/form/element/date.orig.js 2019-09-19 12:30:58.000000000 +0200
+++ view/base/web/js/form/element/date.js 2020-03-17 11:51:49.691288844 +0100
@@ -111,21 +111,19 @@
* Prepares and sets date/time value that will be displayed
* in the input field.
*
- * @param {String} value
+ * @inheritDoc
*/
- onValueChange: function (value) {
View MAGENTO_22407.patch
--- a/Plugin/Block/Topmenu.php
+++ b/Plugin/Block/Topmenu.php
@@ -193,4 +193,21 @@ protected function getCategoryTree($storeId, $rootId)
return $collection;
}
+
+ /**
+ * Add active
+ *
View fix_baler_jquery_cookie.patch
@tdgroot
tdgroot / disable_unused_magento2_modules.sh
Last active Feb 20, 2020
Disable unused Magento 2 modules
View disable_unused_magento2_modules.sh
#!/bin/bash
bin/magento module:status | \
grep -E '(Magento_(Adobe|Inventory|Braintree|Signifyd|Fedex|Marketplace|Authorizenet.*|.*GraphQl.*|.*Analytics)|Temando_|Amazon_|Dotdigitalgroup_|Vertex_|Klarna_)' | \
grep -v Magento_GoogleAnalytics | \
xargs bin/magento module:disable
@tdgroot
tdgroot / MAGENTO_22610.patch
Last active Aug 1, 2019
Patch file for Magento PR 22610
View MAGENTO_22610.patch
diff --git a/Process/Queue.php b/Process/Queue.php
index d8089457ce5b..21de61a6a8e1 100644
--- a/Process/Queue.php
+++ b/Process/Queue.php
@@ -8,9 +8,9 @@
use Magento\Deploy\Package\Package;
use Magento\Deploy\Service\DeployPackage;
use Magento\Framework\App\ResourceConnection;
-use Psr\Log\LoggerInterface;
use Magento\Framework\App\State as AppState;
@tdgroot
tdgroot / PRODSECBUG-2198-2.2-CE-2019-03-25-08-43-16-module-catalog.patch
Last active Jul 31, 2019
Magento 2.2 patch for PRODSECBUG-2198 in composer.patches.json format for magento/module-catalog. See for magento/framework https://gist.github.com/peterjaap/433a07a08962ea8955e64b39c84cc4e3
View PRODSECBUG-2198-2.2-CE-2019-03-25-08-43-16-module-catalog.patch
diff --git a/Model/Product/ProductFrontendAction/Synchronizer.php b/Model/Product/ProductFrontendAction/Synchronizer.php
index 7a1926c..331c667 100644
--- a/Model/Product/ProductFrontendAction/Synchronizer.php
+++ b/Model/Product/ProductFrontendAction/Synchronizer.php
@@ -138,7 +138,9 @@ class Synchronizer
$productIds = [];
foreach ($actions as $action) {
- $productIds[] = $action['product_id'];
+ if (isset($action['product_id']) && is_int($action['product_id'])) {
You can’t perform that action at this time.