oc-shopaholic / oc-toolbox-plugin Goto Github PK
View Code? Open in Web Editor NEW𧰠Toolbox plugin for October CMS
Home Page: https://octobercms.com/plugin/lovata-toolbox
License: GNU General Public License v3.0
π§° Toolbox plugin for October CMS
Home Page: https://octobercms.com/plugin/lovata-toolbox
License: GNU General Public License v3.0
Π ΠΌΠ΅ΡΠΎΠ΄Π΅ setPropertiesFields ΠΏΡΠΎΠΈΡΡ ΠΎΠ΄ΠΈΡ ΠΎΡΠΈΠ±ΠΊΠ°
ErrorException: array_combine(): Both parameters should have an equal number of elements in /var/www/dm500/plugins/lovata/commercemlshopaholic/classes/import/ImportExchangeOffersFromXML.php:87
Π‘Π²ΡΠ·Π°Π½ΠΎ ΡΡΠΎ Ρ ΡΠ΅ΠΌ ΡΡΠΎ Π² Π² ΠΌΠ΅ΡΠΎΠ΄Π΅ prepareImportDataBeforeSave ΡΠΈΠ»ΡΡΡΡΡΡΡΡ Π·Π½Π°ΡΠ΅Π½ΠΈΡ ΠΌΠ°ΡΡΠΈΠ²Π°
if (is_string($sValue)) {
$sValue = trim($sValue);
} elseif (is_array($sValue)) {
$sValue = array_filter($sValue);
}
Π’ΡΠ΄Π° ΠΏΠΎΡΠ»Π΅ ΡΠ°Π·Π±ΠΎΡΠ° xml ΠΏΡΠΈ Π½Π°Π»ΠΈΡΠΈΠΈ ΠΏΡΡΡΠΎΠ³ΠΎ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ Π² xml ΠΏΡΠΈΡ ΠΎΠ΄ΡΡ ΡΠ°ΠΊΠΈΠ΅ ΠΌΠ°ΡΡΠΈΠ²Ρ
array(2) {
[0]=>
string(8) "Π¦Π²Π΅Ρ"
[1]=>
string(12) "Π Π°Π·ΠΌΠ΅Ρ"
}
string(14) "property_value"
array(2) {
[0]=>
string(10) "Π‘Π΅ΡΡΠΉ"
[1]=>
string(0) ""
}
Π‘Π°ΠΌ xml
<ΠΡΠ΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅>
<ΠΠ΄>6e70ae10-5967-11eb-a787-00155de01c01#ab82c437-5968-11eb-a787-00155de01c01</ΠΠ΄>
<ΠΠΎΠΌΠ΅ΡΠΠ΅ΡΡΠΈΠΈ>AAAAAAAA6JQ=</ΠΠΎΠΌΠ΅ΡΠΠ΅ΡΡΠΈΠΈ>
<ΠΠΎΠΌΠ΅ΡΠΊΠ°Π£Π΄Π°Π»Π΅Π½ΠΈΡ>false</ΠΠΎΠΌΠ΅ΡΠΊΠ°Π£Π΄Π°Π»Π΅Π½ΠΈΡ>
<ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅>Π‘Π²ΠΈΡΠ΅Ρ Ρ Π³ΠΎΡΠ»ΠΎΠΌ (Π‘Π΅ΡΡΠΉ One Size)</ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅>
<Π₯Π°ΡΠ°ΠΊΡΠ΅ΡΠΈΡΡΠΈΠΊΠΈΠ’ΠΎΠ²Π°ΡΠ°>
<Π₯Π°ΡΠ°ΠΊΡΠ΅ΡΠΈΡΡΠΈΠΊΠ°Π’ΠΎΠ²Π°ΡΠ°>
<ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅>Π¦Π²Π΅Ρ</ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅>
<ΠΠ½Π°ΡΠ΅Π½ΠΈΠ΅>Π‘Π΅ΡΡΠΉ</ΠΠ½Π°ΡΠ΅Π½ΠΈΠ΅>
</Π₯Π°ΡΠ°ΠΊΡΠ΅ΡΠΈΡΡΠΈΠΊΠ°Π’ΠΎΠ²Π°ΡΠ°>
<Π₯Π°ΡΠ°ΠΊΡΠ΅ΡΠΈΡΡΠΈΠΊΠ°Π’ΠΎΠ²Π°ΡΠ°>
<ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅>Π Π°Π·ΠΌΠ΅Ρ</ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅>
<ΠΠ½Π°ΡΠ΅Π½ΠΈΠ΅/>
</Π₯Π°ΡΠ°ΠΊΡΠ΅ΡΠΈΡΡΠΈΠΊΠ°Π’ΠΎΠ²Π°ΡΠ°>
</Π₯Π°ΡΠ°ΠΊΡΠ΅ΡΠΈΡΡΠΈΠΊΠΈΠ’ΠΎΠ²Π°ΡΠ°>
<ΠΠ½Π°ΡΠ΅Π½ΠΈΡΠ‘Π²ΠΎΠΉΡΡΠ²>
<ΠΠ½Π°ΡΠ΅Π½ΠΈΡΠ‘Π²ΠΎΠΉΡΡΠ²Π°>
<ΠΠ΄>a34f1e65-58ac-11eb-a786-00155de01c01</ΠΠ΄>
<ΠΠ½Π°ΡΠ΅Π½ΠΈΠ΅>ab82c436-5968-11eb-a787-00155de01c01</ΠΠ½Π°ΡΠ΅Π½ΠΈΠ΅>
</ΠΠ½Π°ΡΠ΅Π½ΠΈΡΠ‘Π²ΠΎΠΉΡΡΠ²Π°>
<ΠΠ½Π°ΡΠ΅Π½ΠΈΡΠ‘Π²ΠΎΠΉΡΡΠ²Π°>
<ΠΠ΄>b597ddc0-58ac-11eb-a786-00155de01c01</ΠΠ΄>
<ΠΠ½Π°ΡΠ΅Π½ΠΈΠ΅/>
</ΠΠ½Π°ΡΠ΅Π½ΠΈΡΠ‘Π²ΠΎΠΉΡΡΠ²Π°>
</ΠΠ½Π°ΡΠ΅Π½ΠΈΡΠ‘Π²ΠΎΠΉΡΡΠ²>
<Π¨ΠΈΡΠΈΠ½Π°>0</Π¨ΠΈΡΠΈΠ½Π°>
<ΠΠ»ΠΈΠ½Π°>0</ΠΠ»ΠΈΠ½Π°>
<ΠΡΡΠΎΡΠ°>0</ΠΡΡΠΎΡΠ°>
</ΠΡΠ΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅>
Fix processing of positive results in ComponentSubmitForm::getResponseModeAjax() method, if flash_on enabled
I migrated my project to an S3 storage, and when I try to import models using CSV Import (e.g., shopaholic category) but images are not uploaded.
After some digging, I found out that the problem seems to be in the AbstractImportModelFromCSV helper's initPreviewImage() method on these lines of code:
$this->sPreviewImage = storage_path($this->sPreviewImage);
if (!file_exists($this->sPreviewImage)) {
$this->sPreviewImage = null;
}
Using storage_path() function it will do a file exist on local storage, when it should check if file exists on S3 storage.
Will there be an update to support uploading images through the AbstractImportModelFromCSV helper to S3 storage, or is there an alternative solution?
ΠΠ΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΠΊΠΎΠΏΠΈΡΠΎΠ²Π°ΡΡ Ρ ΠΏΡΠΎΠ΅ΠΊΡΠ° Π°ΡΠ΅Π½Π΄Ρ ΡΠ°ΠΉΠ» ru/lang.php ΠΈ Π·Π°ΠΊΠΎΠΌΠΌΠΈΡΠΈΡΡ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ, Π΅ΡΠ»ΠΈ ΠΎΠ½ΠΈ Π±ΡΠ΄ΡΡ.
https://github.com/oc-shopaholic/oc-toolbox-plugin/blob/master/classes/item/MainItem.php#L253
ΠΡΠΈ ΡΠΎΠ·Π΄Π°Π½ΠΈΠΈ ΠΎΠ±ΡΠ΅ΠΊΡΠ° File Π½Π΅ ΡΠΎΠ·Π΄Π°Π΅ΡΡΡ id , ΡΡΠΎ ΠΏΡΠΈ Π½Π΅ΠΊΠΎΡΠΎΡΠΎΠΌ ΡΡΠ΅ΡΠ΅Π½ΠΈΠΈ ΠΎΠ±ΡΡΠΎΡΡΠ΅Π»ΡΡΡΠ²ΠΎ ΠΌΠΎΠΆΠ΅Ρ ΠΏΡΠΈΠ²Π΅ΡΡΠΈ ΠΊ ΡΠΌΠ΅ΡΠΈΠ²Π°Π½ΠΈΡ ΠΊΠ°ΡΡΠΈΠ½ΠΎΠΊ ΠΏΡΠ΅Π²ΡΡ. Π’.ΠΊ. id ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π΄Π»Ρ ΡΠ½ΠΈΠΊΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ ΠΈΠΌΠ΅Π½ΠΈ.
ΠΠ°ΠΊ Π²Π°ΡΠΈΠ°Π½Ρ ΡΠ΅ΡΠ΅Π½ΠΈΡ
$obFile = File::make($arFileData);
$obFile->disk_name = array_get($arFileData, 'disk_name');
$obFile->id = array_get($arFileData, 'id');
ΠΡΠΈ ΡΠΎΠ·Π΄Π°Π½ΠΈΠΈ Π·Π°ΠΊΠ°Π·Π° Π² ΡΠΎΠΏΠΎΠ³ΠΎΠ»ΠΈΠΊΠ΅, ΠΏΠΎΡΡΠ΅Π±ΠΎΠ²Π°Π»ΠΎΡΡ ΠΏΡΠΈΠΊΡΠ΅ΠΏΠ»ΡΡΡ ΠΊ ΠΏΠΈΡΡΠΌΡ ΠΏΠ΄Ρ ΡΠ°ΠΉΠ». Π‘ΡΠ°Π½Π΄Π°ΡΡΠ½ΡΠΌΠΈ ΡΡΠ΅Π΄ΡΡΠ²Π°ΠΌΠΈ Π¨ΠΎΠΏΠΎΠ³ΠΎΠ»ΠΈΠΊΠ° ΡΠ΄Π΅Π»Π°ΡΡ Π½Π΅ ΠΏΠΎΠ»ΡΡΠΈΠ»ΠΎΡΡ, ΡΠ°ΠΊ ΠΊΠ°ΠΊ Π½Π΅Ρ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΠΈ ΡΠ΅ΡΠ΅Π· ΡΠΎΠ±ΡΡΠΈΠ΅ ΠΏΡΠΈΡΠΎΠ΅Π΄ΠΈΠ½ΠΈΡΡ ΡΠ°ΠΉΠ».
Π‘ΡΠΈΡΠ°Ρ Π½Π°Π΄ΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ ΡΠ°ΠΊΠΎΠ΅ ΡΠΎΠ±ΡΡΠΈΠ΅, ΠΈΠ±ΠΎ ΠΎΠ½ΠΎ Π±ΡΠ΄Π΅Ρ ΠΏΠΎΠ»Π΅Π·Π½ΠΎ Π΄Π»Ρ ΠΌΠ½ΠΎΠ³ΠΈΡ
ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊΠΎΠ² ΠΈ ΠΏΠΎΠ·Π²ΠΎΠ»ΠΈΡ ΠΈΠ·Π±Π΅ΠΆΠ°ΡΡ Π»ΠΈΡΠ½Π΅Π³ΠΎ ΠΊΠΎΠ΄Π°.
Hello,
I'm working with the shopaholic ecosystem. Very good until now except the bad surprise to see that the ajax form validation system completly bypass october way of doing form validation, preventing the use of extra features like inline form validation using <div data-validate-for="my_field"></div>
or other very useful features.
In addition, your actual validation system only return the first field that throw an error whereas ValidationException allow to return an array of fields, with an array of messages allowing to do something like that when you submit an empty form with several required fields
To conclude, I think you should provide a new mode when dealing with form component "ajax with validation" that would handle errors the october way. Like that, people that want to use that mode can do it.
Best regards
/**
* Get element ID list from cache or database
* @param mixed $sFilterValue
* @return array|null
*/
public function get($sFilterValue) : array
{
if (empty($sFilterValue)) {
return [];
}
$this->sValue = $sFilterValue;
if (array_key_exists($this->getCacheKey(), $this->arCachedList) && is_array($this->arCachedList[$this->getCacheKey()])) {
return $this->arCachedList[$this->getCacheKey()];
}
$arElementIDList = $this->getIDList();
$this->arCachedList[$this->getCacheKey()] = $arElementIDList;
return $arElementIDList;
}
ΠΡΠ»ΠΈ sFilterValue 0 ΠΊΠΎΠ³Π΄Π° Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ Π½Π°Π΄ΠΎ ΡΠΈΠ»ΡΡΡΠΎΠ²Π°ΡΡ ΠΏΠΎ ΡΠΈΡΠ»ΠΎΠ²ΡΠΌ Π·Π½Π°ΡΠ΅Π½ΠΈΡΠΌ 0,1,2 ΡΠΎ ΡΠΈΠ»ΡΡΡΠ°ΡΠΈΠΈ Π½Π΅ ΠΏΡΠΎΠΈΡΡ ΠΎΠ΄ΠΈΡ
empty($sFilterValue)
Π±ΡΠ΄Π΅Ρ true
Required improvement for this issue.
Hi, I like to contribute to the localization of this plugin (also other shopaholic plugins).
Would you add Japanese as Crowdin target language?
If you return a custom array via EVENT_BEFORE_IMPORT, this data is not available in functions called by prepareImportData. This is because the event is fired only after prepareImportData.
For example, to ensure that you can edit the preview_image attribute during the import, it is necessary to fire the event before calling the prepareImportData function.
Pull request for this issue:
#91
Any plans to update Toolbox to be compatable with OC3.1, at the moment, many conflicts with Rainlab.Translate plugin, because off many changes, from version 1.x to version 2.x regarding Multisete.
https://github.com/rainlab/translate-plugin/blob/master/UPGRADE.md
I'm running October 3 and I get this error when trying to create my first product with Shopaholic.
Class "RainLab\Translate\Models\Locale" not found" on line 33 of /plugins/lovata/toolbox/traits/helpers/TraitInitActiveLang.php
When I installed Properties for Shopaholic, the error below started appear, and the site cannot be displayed at all.
Class 'Lovata\Toolbox\Classes\Helper\AbstractImportModelFromXML' not found
The cause is that the version of oc-toolbox-plugin installed through composer is a bit old, and thus this class in the error does not exist.
I hope oc-toolbox-plugin on packagist is synched again.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.