Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #481 from Nosto/hotfix/3.8.3
Browse files Browse the repository at this point in the history
Fix double encoding in Oauth redirectURL  & customer address fix
  • Loading branch information
Hannu Pölönen authored Jan 28, 2019
2 parents 1d44ee1 + 3307c0c commit e2bc7fb
Show file tree
Hide file tree
Showing 6 changed files with 264 additions and 148 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

### 3.8.3
* Bump Nosto SDK version to fix the double encoded Oauth redirect URL
* Add null check to customer addresses

### 3.8.2
* Bump Nosto SDK version to support HTTP 2

Expand Down
63 changes: 47 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,79 @@
FROM debian:stretch-slim

MAINTAINER Nosto "[email protected]"

ENV DEBIAN_FRONTEND noninteractive

# Do not install suggested dependencies
RUN echo -n "APT::Install-Recommends \"false\";\nAPT::Install-Suggests \"false\";" \
| tee /etc/apt/apt.conf

# Enable access to metadata and packages using https
RUN apt-get update && \
apt-get -y -qq install apt-transport-https

# Setup locale
RUN apt-get update && \
apt-get -y -qq upgrade && \
apt-get -y -qq install apt-utils locales && \
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && \
ln -sf /etc/locale.alias /usr/share/locale/locale.alias && \
locale-gen && \
apt-get -y -qq clean

ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV TERM xterm
RUN export LC_ALL=en_US.UTF-8

# Environment variables to force the extension to connect to a specified instance
ENV NOSTO_SERVER_URL staging.nosto.com
ENV NOSTO_API_BASE_URL https://staging-api.nosto.com
ENV NOSTO_OAUTH_BASE_URL https://staging.nosto.com/oauth
ENV NOSTO_WEB_HOOK_BASE_URL https://staging.nosto.com
ENV NOSTO_SERVER_URL connect.staging.nosto.com
ENV NOSTO_API_BASE_URL https://api.staging.nosto.com
ENV NOSTO_OAUTH_BASE_URL https://my.staging.nosto.com/oauth
ENV NOSTO_WEB_HOOK_BASE_URL https://my.staging.nosto.com
ENV NOSTO_IFRAME_ORIGIN_REGEXP .*

ENV MYSQL_ENV_MYSQL_DATABASE magento2
ENV MYSQL_ENV_MYSQL_DATABASE magento
ENV MYSQL_ENV_MYSQL_USER root
ENV MYSQL_ENV_MYSQL_ROOT root
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV DEBIAN_FRONTEND noninteractive

MAINTAINER Nosto "[email protected]"

# Install all core dependencies required for setting up Apache and PHP atleast
RUN apt-get update && apt-get -y -q install unzip wget libfreetype6-dev libjpeg-dev \
# Add php-7.1 Source List
RUN apt-get -y -qq install lsb-release ca-certificates wget
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN apt-get -y -qq update

# Install all core dependencies required for setting up Apache and PHP at least
RUN apt-get -y -qq install unzip wget libfreetype6-dev libjpeg-dev \
libmcrypt-dev libreadline-dev libpng-dev libicu-dev default-mysql-client \
libmcrypt-dev libxml2-dev libxml2-utils libxslt1-dev vim nano git tree curl \
supervisor ca-certificates && \
apt-get -y clean
apt-get -y -qq clean

# Install Apache, MySQL and all the required development and prod PHP modules
RUN apt-get -y -q install apache2 php7.0 default-mysql-client-core \
default-mysql-server-core default-mysql-server php7.0-dev php7.0-gd \
php7.0-mcrypt php7.0-intl php7.0-xsl php7.0-zip php7.0-bcmath \
php7.0-curl php7.0-mbstring php7.0-mysql php-ast php7.0-soap && \
RUN apt-get -y -qq install apache2 php7.1 php7.1-common default-mysql-client-core \
default-mysql-server-core default-mysql-server php7.1-dev \
php7.1-mcrypt php7.1-xsl php7.1-zip php7.1-bcmath php7.1-intl php7.1-gd \
php7.1-curl php7.1-mbstring php7.1-mysql php7.1-soap php-xml php7.1-xml && \
apt-get -y clean

# Upgrade ast extension
RUN apt-get -y -q install build-essential php-pear && \
# Upgrade AST extension
RUN apt-get -y -qq install build-essential php-pear && \
pecl install ast-0.1.6 && \
apt-get purge -y build-essential && \
apt-get -y clean

RUN a2enmod rewrite && phpenmod ast soap && \
# Enable AST extension
RUN echo "extension=ast.so" >> /etc/php/7.1/cli/php.ini

RUN a2enmod rewrite && phpenmod soap && \
a2dissite 000-default.conf


RUN php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php && \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
php -r "unlink('composer-setup.php');"
Expand Down
10 changes: 9 additions & 1 deletion app/code/community/Nosto/Tagging/Block/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,15 @@ public function getNostoCustomer()
if ($customerAddress instanceof Mage_Customer_Model_Address) {
try {
$nostoCustomer->setCity($customerAddress->getCity());
$nostoCustomer->setStreet($customerAddress->getStreet()[0].' '.$customerAddress->getStreet()[1]);
$streetAddress = $customerAddress->getStreet();
$concatenatedStreetAddress = '';
if (!empty($streetAddress[0])) {
$concatenatedStreetAddress .= $streetAddress[0];
}
if (!empty($streetAddress[1])) {
$concatenatedStreetAddress .= ' ' . $streetAddress[1];
}
$nostoCustomer->setStreet($concatenatedStreetAddress);
$customerRegion = $customerAddress->getRegion();
if ($customerRegion) {
$nostoCustomer->setRegion($customerRegion);
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Nosto/Tagging/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<config>
<modules>
<Nosto_Tagging>
<version>3.8.2</version>
<version>3.8.3</version>
</Nosto_Tagging>
</modules>
<global>
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
},
"require": {
"php": ">=5.4.0",
"nosto/php-sdk": "3.9.0"
"nosto/php-sdk": "3.9.1"
},
"require-dev": {
"php": ">=7.1.0",
"mridang/magazine": "0.1",
"phing/phing": "2.*",
"phan/phan": "0.8.9",
Expand Down
Loading

0 comments on commit e2bc7fb

Please sign in to comment.