Skip to content

Commit

Permalink
Merge pull request #272 from Nosto/hotfix/3.6.1
Browse files Browse the repository at this point in the history
Bump SDK, fix two bugs in product category constructing, bump version…
  • Loading branch information
Hannu Pölönen authored Jan 24, 2019
2 parents c75622e + 9f524ce commit 31ef6a4
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 196 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning(http://semver.org/).

## 3.6.1
- Bump Nosto SDK version to fix the double encoded Oauth redirect URL
- Fix constructing the product categories

## 3.6.0
- Bump Nosto SDK version to support HTTP 2

Expand Down
51 changes: 39 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
FROM debian:stretch-slim

MAINTAINER Nosto "platforms@nosto.com"

# 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 prestashop
Expand All @@ -18,7 +37,12 @@ ENV MYSQL_ENV_MYSQL_ROOT root
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV DEBIAN_FRONTEND noninteractive

MAINTAINER Nosto "platforms@nosto.com"

# 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 atleast
RUN apt-get update && apt-get -y -q install unzip wget libfreetype6-dev libjpeg-dev \
Expand All @@ -28,18 +52,21 @@ RUN apt-get update && apt-get -y -q install unzip wget libfreetype6-dev
apt-get -y 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

# Enable AST extension
RUN echo "extension=ast.so" >> /etc/php/7.1/cli/php.ini

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

Expand Down
3 changes: 1 addition & 2 deletions classes/models/NostoCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ public static function loadData(Category $category)
*/
private static function buildCategoryString($categoryList)
{
if(!is_array($categoryList)) {
if (is_array($categoryList)) {
return implode(DIRECTORY_SEPARATOR, array_reverse($categoryList))
. DIRECTORY_SEPARATOR;
}

return null;

}
}
6 changes: 3 additions & 3 deletions classes/models/NostoProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ protected function amendCategories(Product $product)
$productCategories = $product->getCategories();
foreach ($productCategories as $categoryId) {
$category = new Category((int)$categoryId, NostoHelperContext::getLanguageId());
$category = NostoCategory::loadData($category);
if (!empty($category)) {
$this->addCategory($category->getValue());
$nostoCategory = NostoCategory::loadData($category);
if (!empty($nostoCategory)) {
$this->addCategory($nostoCategory->getCategoryString());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nosto/nostotagging",
"description": "Nosto Module for Prestashop",
"require": {
"nosto/php-sdk": "3.9.0"
"nosto/php-sdk": "3.9.1"
},
"require-dev": {
"phing/phing": "2.*",
Expand Down
Loading

0 comments on commit 31ef6a4

Please sign in to comment.