Skip to content

Instantly share code, notes, and snippets.

View lewisvoncken's full-sized avatar

Mr. Lewis lewisvoncken

  • Happy Horizon Utrecht
View GitHub Profile
diff --git a/app/etc/di.xml b/app/etc/di.xml
index ace043beb62..7751604ea1d 100644
--- a/app/etc/di.xml
+++ b/app/etc/di.xml
@@ -1896,12 +1896,12 @@
</type>
<type name="Magento\Framework\Webapi\Validator\EntityArrayValidator">
<arguments>
- <argument name="complexArrayItemLimit" xsi:type="number">20</argument>
+ <argument name="complexArrayItemLimit" xsi:type="number">999999</argument>
@lewisvoncken
lewisvoncken / duplicate-category-community.php
Created November 25, 2020 13:26
Duplicate Category Community (or Enterprise without Staging Modules)
<?php
// use shell_exec("mysql -e '{$sql}'"); for mysql_query or use pdo or something
$catId = 2;
$xml = simplexml_load_file('app/etc/local.xml');
$host = "";
$username = "";
@lewisvoncken
lewisvoncken / duplicate-category-enterprise.php
Last active November 24, 2020 21:29
Duplicate Script Category Magento 2 enterprise (will probably also work for Magento 1)
<?php
// use shell_exec("mysql -e '{$sql}'"); for mysql_query or use pdo or something
$catId = 2;
$host = "";
$username = "";
$password = "";
$dbname = "";
#!/bin/bash
TIME=$(date +%s)
# xp-varnish.vcl is used so it can not be overwritten by the varnish.vcl generated through the admin
varnishadm vcl.load mag2_$TIME /data/web/magento2/var/xp-varnish.vcl
varnishadm vcl.use mag2_$TIME
printf "${YELLOW}NOTICE${NC} - Please ignore the error below.\n";
varnishadm vcl.discard boot
@lewisvoncken
lewisvoncken / zmagereport.sh
Last active April 1, 2020 19:40
magereport nginx updater
sed -i.bak $'s/}/\\\t188.166.64.179 "off"; \# magereport.com\\\n\\\t178.62.230.112 "off"; \# magereport.com\\\n}/g' /data/web/nginx/whitelist-development-exception.conf; hypernode-servicectl reload nginx
@lewisvoncken
lewisvoncken / DB_CLEANUP_SCRIPT.php
Last active May 30, 2022 11:11
CVE-2019-8118 - DB_CLEANUP_SCRIPT
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Framework\App\Bootstrap;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\DB\Query\Generator;
use Magento\Framework\Exception\LocalizedException;
SELECT DISTINCT u.url_rewrite_id from store as s
INNER JOIN store_group as sg
ON s.group_id = sg.group_id
INNER JOIN catalog_category_entity as c
ON sg.root_category_id = SUBSTRING_INDEX(SUBSTRING_INDEX(c.path, '/', 2), '/', -1)
LEFT JOIN url_rewrite as u
ON c.entity_id = u.entity_id AND s.store_id != u.store_id
WHERE entity_type = 'category'
@lewisvoncken
lewisvoncken / PRODSECBUG-2198-2.1-CE-2019-04-01-10-21-16-framework.patch
Last active April 1, 2019 08:24 — forked from barryvdh/PRODSECBUG-2198-2.2-CE-2019-03-25-08-43-16-framework.patch
Magento 2.2 patch for PRODSECBUG-2198 in composer.patches.json format for magento/framework, using `cweagans/composer-patches`
diff --git a/DB/Adapter/Pdo/Mysql.php b/DB/Adapter/Pdo/Mysql.php
index a43f39a..4db98b6 100644
--- a/DB/Adapter/Pdo/Mysql.php
+++ b/DB/Adapter/Pdo/Mysql.php
@@ -2796,7 +2796,7 @@ class Mysql extends \Zend_Db_Adapter_Pdo_Mysql implements AdapterInterface
if (isset($condition['to'])) {
$query .= empty($query) ? '' : ' AND ';
$to = $this->_prepareSqlDateCondition($condition, 'to');
- $query = $this->_prepareQuotedSqlCondition($query . $conditionKeyMap['to'], $to, $fieldName);
+ $query = $query . $this->_prepareQuotedSqlCondition($conditionKeyMap['to'], $to, $fieldName);
@lewisvoncken
lewisvoncken / url_path_flat_children_category.patch
Created February 14, 2018 12:42
url_path_flat_children_category
From 96be1ce725616f6282636db8630f08f6d068c1e0 Mon Sep 17 00:00:00 2001
From: Lewis Voncken <lewis@experius.nl>
Date: Wed, 16 Aug 2017 16:07:17 +0000
Subject: [PATCH] [BUGFIX] Flat Category reindexList of AllChildren if the
url_key of the current category has changed
---
vendor/magento/module-catalog/Model/Category.php | 3 +++
1 file changed, 3 insertions(+)