Giter Club home page Giter Club logo

oc-toolbox-plugin's People

Contributors

alvaro-canepa avatar assmay avatar dinwid avatar flusherdock1 avatar igor-tv avatar kharanenka avatar kornep avatar lautsevich avatar mjauvin avatar philmarc avatar pikanji avatar sebastiaankloos avatar wobqqq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

oc-toolbox-plugin's Issues

ErrorException: array_combine() ΠΏΡ€ΠΈ ΠΈΠΌΠΏΠΎΡ€Ρ‚Π΅ xml

Π’ ΠΌΠ΅Ρ‚ΠΎΠ΄Π΅ 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</Высота>
</ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅>

When using AbstractImportModelFromCSV, images cannot be uploaded to S3 storage

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?

[Toolbox] Update ru/lang.php

НСобходимо ΡΠΊΠΎΠΏΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ с ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° Π°Ρ€Π΅Π½Π΄Ρ‹ Ρ„Π°ΠΉΠ» 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');

Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ для прикрСплСния Ρ„Π°ΠΉΠ»Π° ΠΊ ΠΏΠΈΡΡŒΠΌΡƒ

ΠŸΡ€ΠΈ создании Π·Π°ΠΊΠ°Π·Π° Π² шопоголикС, ΠΏΠΎΡ‚Ρ€Π΅Π±ΠΎΠ²Π°Π»ΠΎΡΡŒ ΠΏΡ€ΠΈΠΊΡ€Π΅ΠΏΠ»ΡΡ‚ΡŒ ΠΊ ΠΏΠΈΡΡŒΠΌΡƒ ΠΏΠ΄Ρ„ Ρ„Π°ΠΉΠ». Π‘Ρ‚Π°Π½Π΄Π°Ρ€Ρ‚Π½Ρ‹ΠΌΠΈ срСдствами Π¨ΠΎΠΏΠΎΠ³ΠΎΠ»ΠΈΠΊΠ° ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ Π½Π΅ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΠ»ΠΎΡΡŒ, Ρ‚Π°ΠΊ ΠΊΠ°ΠΊ Π½Π΅Ρ‚ возмоТности Ρ‡Π΅Ρ€Π΅Π· событиС ΠΏΡ€ΠΈΡΠΎΠ΅Π΄ΠΈΠ½ΠΈΡ‚ΡŒ Ρ„Π°ΠΉΠ».
Π‘Ρ‡ΠΈΡ‚Π°ΡŽ Π½Π°Π΄ΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ Ρ‚Π°ΠΊΠΎΠ΅ событиС, ΠΈΠ±ΠΎ ΠΎΠ½ΠΎ Π±ΡƒΠ΄Π΅Ρ‚ ΠΏΠΎΠ»Π΅Π·Π½ΠΎ для ΠΌΠ½ΠΎΠ³ΠΈΡ… Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΎΠ² ΠΈ ΠΏΠΎΠ·Π²ΠΎΠ»ΠΈΡ‚ ΠΈΠ·Π±Π΅ΠΆΠ°Ρ‚ΡŒ лишнСго ΠΊΠΎΠ΄Π°.

Add ajax validation mode for form component

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

image

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

Ρ„ΠΈΠ»ΡŒΡ‚Ρ€Π°Ρ†ΠΈΡ ΠΏΠΎ числовым значСниям, 0 Π½Π΅ Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚

/**
     * 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

Make data returned from EVENT_BEFORE_IMPORT available to functions like initPreviewImage

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

Class "RainLab\Translate\Models\Locale" not found"

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

The latest version in packagist does not work with paid plugins

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.