Skip to content

Instantly share code, notes, and snippets.

View AurelienLavorel's full-sized avatar

Aurélien Lavorel AurelienLavorel

View GitHub Profile
@AurelienLavorel
AurelienLavorel / avoid_amasty_labels_update.patch
Last active June 19, 2020 16:01
Avoid amasty labels update to make it work on PlatformSH
diff --git a/vendor/amasty/label/Setup/UpgradeSchema.php b/vendor/amasty/label/Setup/UpgradeSchema.php
index f1d749a..2504a2d 100644
--- a/vendor/amasty/label/Setup/UpgradeSchema.php
+++ b/vendor/amasty/label/Setup/UpgradeSchema.php
@@ -81,10 +81,10 @@ class UpgradeSchema implements UpgradeSchemaInterface
if (version_compare($context->getVersion(), '1.6.0', '<')) {
$this->createIndexTable($setup);
}
- if (version_compare($context->getVersion(), '1.7.0', '<')) {
+ /*if (version_compare($context->getVersion(), '1.7.0', '<')) {
diff --git a/vendor/magento/framework/App/View/Deployment/Version.php b/vendor/magento/framework/App/View/Deployment/Version.php
index 05c8e39f524658b559ad7d3df37d598c443c12ef..f28c42cd2751caa14716efffe5a757f9988200f7 100644
--- a/vendor/magento/framework/App/View/Deployment/Version.php
+++ b/vendor/magento/framework/App/View/Deployment/Version.php
@@ -84,10 +84,7 @@
ConfigOptionsListConstants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION
)
) {
- $this->getLogger()->critical('Can not load static content version.');
- throw new \UnexpectedValueException(
diff --git a/vendor/magento/framework/Data/AbstractSearchResult.php b/vendor/magento/framework/Data/AbstractSearchResult.php
index 05c8e39f524658b559ad7d3df37d598c443c12ef..f28c42cd2751caa14716efffe5a757f9988200f7 100644
--- a/vendor/magento/framework/Data/AbstractSearchResult.php
+++ b/vendor/magento/framework/Data/AbstractSearchResult.php
@@ -265,11 +265,6 @@ abstract class AbstractSearchResult extends AbstractDataObject implements Search
{
$itemId = $this->getItemId($item);
if ($itemId !== null) {
- if (isset($this->data['items'][$itemId])) {
- throw new \Exception(
@AurelienLavorel
AurelienLavorel / fix_empty_customer_id_on_customer_cart.patch
Created September 20, 2019 10:00
fix empty customer id on customer cart
Index: vendor/magento/module-quote/Model/QuoteManagement.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/vendor/magento/module-quote/Model/QuoteManagement.php (date 1568972641000)
+++ src/vendor/magento/module-quote/Model/QuoteManagement.php (date 1568972665300)
@@ -543,7 +543,7 @@
}
@AurelienLavorel
AurelienLavorel / fix_404_error_on_homepage.patch
Last active September 19, 2019 21:47
fix 404 error on homepage
Index: vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php (date 1568877775000)
+++ src/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php (date 1568877794582)
@@ -69,7 +69,7 @@
return $proceed($request);
}
@AurelienLavorel
AurelienLavorel / fix_empty_block_error.patch
Created September 4, 2019 09:24
fix_empty_block_error.patch
Index: vendor/magento/module-sales/Block/Adminhtml/Items/AbstractItems.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/vendor/magento/module-sales/Block/Adminhtml/Items/AbstractItems.php (date 1567588428000)
+++ src/vendor/magento/module-sales/Block/Adminhtml/Items/AbstractItems.php (date 1567588442526)
@@ -85,7 +85,7 @@
{
foreach ($blocks as $blockName) {
@AurelienLavorel
AurelienLavorel / patch
Created August 25, 2019 20:15
Fix session patch
diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php
index 8386fb8..a287df6 100644
--- a/app/code/core/Mage/Core/Model/Session/Abstract.php
+++ b/app/code/core/Mage/Core/Model/Session/Abstract.php
@@ -564,6 +564,8 @@ class Mage_Core_Model_Session_Abstract extends Mage_Core_Model_Session_Abstract_
*/
public function renewSession()
{
+ return $this;
+
@AurelienLavorel
AurelienLavorel / s.xml
Created December 30, 2018 15:41
Magento SOAP API call example
Contain the downloaded SOAP WSDL, you can copy paste it from /soap/?wsdl_list
@AurelienLavorel
AurelienLavorel / rest.php
Created December 30, 2018 15:36
Magento REST API call example
<?php
$userData = array("username" => "xxx", "password" => "xxx");
$domain = "https://www.example.com";
$orderId = "159053";
//$orderId = "?searchCriteria[filter_groups][0][filters][0][field]=entity_id&searchCriteria[filter_groups][0][filters][0][value]=150526";
$ch = curl_init("{$domain}/index.php/rest/V1/integration/admin/token");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_USERPWD, "test:test");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
=SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(SUBSTITUE(A2;"\n";"");")";"");"(";"");":";"");"/";"");"î";"i");"ê";"e");".";"");",";"");"à";"a");"Ø";"");"è";"e");"é";"e");"'";"");"-";"_");" ";"_")