Skip to content

Instantly share code, notes, and snippets.

View piotrekkaminski's full-sized avatar

Piotr Kaminski piotrekkaminski

View GitHub Profile
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@piotrekkaminski
piotrekkaminski / Magento Community Edition Security Issue Patch
Created December 11, 2013 06:37
Please see file below for version to patch mapping information.
No need to install this patch for Magento Community Edition version 1.8.0.0 or later
PATCH_SUPEE-2530_CE_1.4.0.0-1.4.0.1_v1.sh for:
CE v1.4.0.0
CE v1.4.0.1
PATCH_SUPEE-2529_CE_1.4.1.0-1.5.0.1_v1.sh for:
CE v1.4.1.0
CE v1.4.1.1
CE v1.4.2.0
Malware that steal card numbers during checkout, targeting Magento based stores
www.3guysgolfcarts.com - Regexp("onepage|checkout")
www.marisaperry.com - eval(atob(
bocolife.com - regexp('onestepcheckout')
www.vimedis.fr - regexp("checkout")
some others to try
https://accesscards.co.uk
https://www.actiumplus.dk
In order to run test on any custom theme first of all you need to update all changed blocks according to new flow. To do this you need
1) create separate theme folder dev/tests/functional/tests/theme/responsive
2) create block that has another behavior then in default theme dev/tests/functional/tests/theme/responsive/Mage/Catalog/Test/Block/Search.php
3) update files autoload in composer.json
"autoload": {
"psr-4": {
"Magento\\": ["lib/Magento/", "vendor/magento/mtf/Magento/", "testsuites/Magento/"],
"Mage\\": ["generated/Mage/", "tests/theme/responsive/Mage/", "tests/app/Mage/"],
"Enterprise\\": ["generated/Community/", "tests/app/Community/"],
@piotrekkaminski
piotrekkaminski / gist:7f2d90232ad36ea42a61
Last active March 31, 2016 20:35
Customer attribute example
Let’s assume that new module (app/code/community/NewCustomerAttributeModule) adds new select attribute to customer backend form which is displayed on ‘My Dashboard’ in customer account on Frontend.
We are going to test this attribute while creating customer on Backend.
The following needs to be done:
1) As you added a new namespace, file dev/tests/functional/composer.json should be updated to use it:
"psr-4": {
"Magento\\": ["lib/Magento/", "vendor/magento/mtf/Magento/", "testsuites/Magento/"],
"Mage\\": ["generated/Mage/", "tests/app/Mage/"],
"Enterprise\\": ["generated/Community/", "tests/app/Community/"],
"Community\\": ["generated/Community/", "tests/app/Community/"],
"Test\\": "generated/Test/"
Index: downloader/lib/Mage/HTTP/Client/Curl.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- downloader/lib/Mage/HTTP/Client/Curl.php (revision 775b8b8d41a4079655efb9e64fc869baf44646e5)
+++ downloader/lib/Mage/HTTP/Client/Curl.php (revision )
@@ -379,7 +379,7 @@
$this->curlOption(CURLOPT_URL, $uri);
version: '2'
services:
web:
build: .
ports:
- "80:80"
volumes:
- ./data:/var/www
links:
- db
@piotrekkaminski
piotrekkaminski / 416.patch
Created September 24, 2016 04:06
MAGETWO-56955 [Backport] - Validation message displayed all the time - for 2.0 MAGETWO-57681 [GITHUB] Customer cannot reorder if the order has been invoiced or shipped #6278
diff --git a/app/code/Magento/Sales/Model/ResourceModel/Order/Item/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Order/Item/Collection.php
index 8872525..9fa5c8a 100644
--- a/app/code/Magento/Sales/Model/ResourceModel/Order/Item/Collection.php
+++ b/app/code/Magento/Sales/Model/ResourceModel/Order/Item/Collection.php
@@ -55,6 +55,7 @@ protected function _afterLoad()
* Assign parent items
*/
foreach ($this as $item) {
+ $this->_resource->unserializeFields($item);
if ($item->getParentItemId()) {
FROM alexcheng/apache2-php7
MAINTAINER Piotr Kaminski <peter@magento.com>
RUN a2enmod rewrite
RUN rm -rf /var/www/html/*
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN requirements="libpng12-dev libmcrypt-dev libmcrypt4 libcurl3-dev libfreetype6 libjpeg-turbo8 libjpeg-turbo8-dev libpng12-dev libfreetype6-dev libicu-dev libxslt1-dev" \
#!/bin/bash
mkdir /var/www/html
cd /var/www/html
# create magento project
composer create-project --repository-url=https://repo.magento.com/ $MAGENTO_PROJECT .
# change permissions
chsh -s /bin/bash www-data