diff --git a/Modules/Application/Controllers/Admin/d3_article_attribute_ajax_multivalues.php b/Modules/Application/Controllers/Admin/d3_article_attribute_ajax_multivalues.php index e476bd6..8a52ed2 100644 --- a/Modules/Application/Controllers/Admin/d3_article_attribute_ajax_multivalues.php +++ b/Modules/Application/Controllers/Admin/d3_article_attribute_ajax_multivalues.php @@ -28,7 +28,7 @@ use OxidEsales\Eshop\Core\Registry; class d3_article_attribute_ajax_multivalues extends d3_article_attribute_ajax_multivalues_parent { /** - * Returns SQL query for data to fetc + * Returns SQL query for data to fetch * * @return string */ @@ -64,7 +64,6 @@ class d3_article_attribute_ajax_multivalues extends d3_article_attribute_ajax_mu $articleId = $request->getRequestParameter("oxid"); $attributeId = $request->getRequestParameter("attr_oxid"); $attributeValue = $request->getRequestParameter("attr_value"); - $article = oxNew(Article::class); if ($article->load($articleId)) { if ($article->isDerived()) { @@ -75,9 +74,9 @@ class d3_article_attribute_ajax_multivalues extends d3_article_attribute_ajax_mu if (isset($attributeId) && ("" != $attributeId)) { $viewName = $this->_getViewName("oxobject2attribute"); - $quotedArticleId = $database->quote($article->getId()); - // D3: remove unused attrid selection - $select = "select * from {$viewName} where {$viewName}.oxobjectid= {$quotedArticleId}"; + $quotedObject2Id = $database->quote($request->getRequestEscapedParameter('o2attr_oxid')); + // D3: switch to ObjectTo oxid + $select = "select * from {$viewName} where {$viewName}.oxid= {$quotedObject2Id}"; $objectToAttribute = oxNew(MultiLanguageModel::class); $objectToAttribute->setLanguage($request->getRequestParameter('editlanguage')); $objectToAttribute->init("oxobject2attribute"); diff --git a/README.md b/README.md index c099bc1..9ee42a6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +![stability mature](https://img.shields.io/badge/stability-mature-008000.svg) +[![latest tag](https://img.shields.io/packagist/v/d3/attributemultivalues?label=release)](https://packagist.org/packages/d3/attributemultivalues) +![License](https://img.shields.io/packagist/l/d3/attributemultivalues) + # Multiple value assignment to attributes This package supports the multiple assignment of attribute values. This allows you to describe your articles in more detail and offer more flexible filters. @@ -19,5 +23,15 @@ These additional filter options can be used in our [advanced search](https://pac Run this composer statement in your shop. Adjust this command if your installation requires it. ``` -composer require d3/attributemultivalues --update-no-dev +composer require d3/attributemultivalues [--update-no-dev] ``` + +Apply required patch: + +``` +composer require cweagans/composer-patches; +composer config --json extra.patches.oxid-esales/oxideshop-ce '{"add multi assignment to article attribute ajax template - 2020-02-25-1": "https://git.d3data.de/D3Public/AttributeMultiValues/raw/branch/rel_2.x/patches/article_attribute_ajax.patch"}' +rm -rf vendor/oxid-esales/oxideshop-ce +composer install +composer update --lock // confirm overwriting oxideshop-ce files +``` \ No newline at end of file