diff --git a/Plugin/Ui/DataProvider/Product/DataProviderPlugin.php b/Plugin/Ui/DataProvider/Product/DataProviderPlugin.php new file mode 100644 index 0000000..6501422 --- /dev/null +++ b/Plugin/Ui/DataProvider/Product/DataProviderPlugin.php @@ -0,0 +1,63 @@ +getField() == 'posted_to_instagram') { + $collection = $subject->getCollection(); + $select = $collection->getSelect(); + $partsFrom = $select->getPart(Select::FROM); + + if (isset($partsFrom['at_posted_to_instagram'])) { + if ($whereParts = $select->getPart(Select::WHERE)) { + foreach ($whereParts as $key => $wherePartItem) { + $whereParts[$key] = $this->_replaceFilterCondition($wherePartItem); + } + $select->setPart(Select::WHERE, $whereParts); + } + } + } + } + + /** + * Replace table alias in condition string + * + * @param string|null $conditionString + * @return string|null + */ + protected function _replaceFilterCondition($conditionString) + { + if ($conditionString === null) { + return null; + } + + if ($conditionString == "(at_posted_to_instagram.value = '0')") { + $conditionString = "(at_posted_to_instagram.value = '0' OR at_posted_to_instagram.value IS NULL)"; + } + + return $conditionString; + } +} \ No newline at end of file diff --git a/README.md b/README.md index f4e0849..8574458 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This Magento 2 extension Auto Instagram Post allows you add your products immedi [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bf0757d0063e489eb3bff2479964fce2)](https://www.codacy.com/app/GhoSterInc/AutoInstagramPost?utm_source=github.com&utm_medium=referral&utm_content=tuyennn/AutoInstagramPost&utm_campaign=Badge_Grade) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/thinghost) -![Version 1.1.5](https://img.shields.io/badge/Version-1.1.5-green.svg) +![Version 1.1.5](https://img.shields.io/badge/Version-1.1.6-green.svg) --- ## [![Alt GhoSter](http://thinghost.info/wp-content/uploads/2015/12/ghoster.png "thinghost.info")](http://thinghost.info) Overview diff --git a/composer.json b/composer.json index 59619e4..02298aa 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "type": "magento2-module", - "version": "1.1.5", + "version": "1.1.6", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml index fdf19a9..d89d51b 100644 --- a/etc/adminhtml/di.xml +++ b/etc/adminhtml/di.xml @@ -31,4 +31,7 @@ + + + \ No newline at end of file diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 5775373..8f6fedd 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -10,7 +10,7 @@ GhoSter_AutoInstagramPost::config - + Magento\Config\Model\Config\Source\Yesno @@ -18,7 +18,7 @@ required-entry - 1 + 1 required-entry @@ -26,7 +26,7 @@ Magento\Config\Model\Config\Backend\Encrypted - 1 + 1 required-entry @@ -35,7 +35,7 @@ - + Magento\Config\Model\Config\Source\Yesno - 1 + 1 @@ -70,8 +70,8 @@ Magento\Config\Model\Config\Source\Yesno - 1 - 1 + 1 + 1 @@ -79,16 +79,16 @@ Magento\Config\Model\Config\Source\Yesno - 1 - 1 + 1 + 1 Magento\Config\Model\Config\Source\Yesno - 1 - 1 + 1 + 1 @@ -97,8 +97,8 @@ GhoSter\AutoInstagramPost\Model\Config\Backend\Hashtag - 1 - 1 + 1 + 1 1 @@ -106,8 +106,8 @@ Instagram caption character limit: 2,200 characters
Instagram hashtag limit: 30 hashtags
Instagram bio character limit: 150 characters]]>
- 1 - 1 + 1 + 1
@@ -117,7 +117,7 @@ Magento\Config\Model\Config\Source\Yesno - 1 + 1 @@ -137,7 +137,7 @@ - 1 + 1 validate-zero-or-greater diff --git a/etc/module.xml b/etc/module.xml index aaf3b87..cffdd8b 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file