Skip to content

Instantly share code, notes, and snippets.

View piotrekkaminski's full-sized avatar

Piotr Kaminski piotrekkaminski

View GitHub Profile
@piotrekkaminski
piotrekkaminski / docker_beta.md
Last active April 10, 2017 23:56
Docker Beta Installation Info & FAQ
@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()) {
#!/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
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" \
version: '2'
services:
web:
build: .
ports:
- "80:80"
volumes:
- ./data:/var/www
links:
- db
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
@piotrekkaminski
piotrekkaminski / gist:9bc45ec84028611d621e
Last active August 8, 2023 08:38
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/help
4) Profit!
diff --git a/app/code/core/Mage/Cms/Block/Block.php b/app/code/core/Mage/Cms/Block/Block.php
index bc81de3..a0dce44 100755
--- a/app/code/core/Mage/Cms/Block/Block.php
+++ b/app/code/core/Mage/Cms/Block/Block.php
@@ -72,4 +72,24 @@ protected function _toHtml()
}
return $html;
}
+
+ /**
FAQ:
We want to run the tests on a custom website. The tests assume main website called Main Website and do not work. Is there a way to provide custom name without changing the tests?
This is an error in the tests. Instead of Main Website it should be main_website and it will select the default website. This patch will be included in next MTF release.
https://gist.github.com/piotrekkaminski/df0b6f570aa410a3c7f6
I get errors in Mage\Adminhtml\Test\TestCase\CreateWebsiteEntityTest. How can I fix it?
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/"],