Why use a DI virtualType without an explicit type?

From the Customize using a modifier class tutorial:

<virtualType name="MagentoCatalogUiDataProviderProductFormModifierPool"> <arguments> <argument name="modifiers" xsi:type="array"> <item name="advancedInventory" xsi:type="array"> <item name="class" xsi:type="string">MagentoCatalogInventoryUiDataProviderProductFormModifierAdvancedInventory</item> <item name="sortOrder" xsi:type="number">20</item> </item> </argument> </arguments> </virtualType>

Why does the <virtualType> element not have a type attribute? Is it mistakenly omitted? Should the authors of that tutorial used a <type> element instead of a <virtualType> element?

submitted by /u/dotancohen
[link] [comments]

Malware – how to find the offending files

A client’s site apparently has js/spy.banker.kj malware on its basket/cart page. I found some code in View Source that matches code that is highlighted elsewhere as being the dodgy code – https://forum.eset.com/topic/35067-help-detecting-the-threat-jsspybankerkj-trojan/

I do not have a copy of the site locally and it is taking a while to download – I don’t have access to the site except through SSH and cpanel. On cpanel in the File manager, the search is only searching file names, not content. I have tried via SSH to grep the content with the likes of

rep -lrIi aHR0cHM6Ly93d3 public_html > outputfile.txt

find ./ -name "*.php" -exec grep -r -l -I "aHR0cHM6Ly93d3" {} ;

find / -type f -name "*.js" -exec grep -il 'aHR0cHM6Ly93d3' {}; > output.txt

grep -r "aHR0cHM6Ly93d3"

grep -rli "atob" *.php

but am getting errors like no such file etc:

[website@website-32 public_html]$ grep -lrIi aHR0cHM6Ly93d3 public_html > outputfile.txt

grep: public_html: No such file or directory

[website@website-32 public_html]$ grep -lrIi aHR0cHM6Ly93d3 outputfile.txt

[website@website-32 public_html]$ find ./ -name "*.php" -exec grep -r -l -I "aHR0cHM6Ly93d3" {}

> ^C

[website@website-32 public_html]$ find / -type f -name "*.js" -exec grep -il 'aHR0cHM6Ly93d3' {}; > output.txt

find: missing argument to -exec’`

[website@website-32 public_html]$ find / -type f -name "*.js" -exec grep -r -il 'aHR0cHM6Ly93d3' {}; > output.txt

find: missing argument to -exec’`

[website@website-32 public_html]$ cd lib

[website@website-32 lib]$ grep -r "aHR0cHM6Ly93d3" *.js

grep: *.js: No such file or directory

[website@website-32 lib]$ grep -r "aHR0cHM6Ly93d3"

[website@website-32 lib]$ grep -rli "atob" *.php

grep: *.php: No such file or directory

[website@website-32 lib]$

Can anyone suggest where to look for the source of the malware? Or how to grep successfully? Thanks!

submitted by /u/hawthornmage
[link] [comments]

Cant create files or directory on Bitnami/Magento stack

Hi,
Ive installed the bitnami/magento stack and all has gone well.
Ive enabled ssh and can sftp to the directory using the default bitnami user but I cant create any new directories. I try to update to 777 but it reverts back.
I tried to give user:bitnami r+w on the directory but it crashed the site and i had to re-install the server.

I assume bitnami is not the root user for sftp but I cant work out what user to log in to sftp with other then the default bitnami/bitnami

Any assistance would be great before I break the stack again.

here is the output from FileZilla
——

Command: cd “/bitnami/magento”

Response: New directory is: “/bitnami/magento”

Command: mkdir “Ie_connector”

Error: mkdir /bitnami/magento/Ie_connector: permission denied

Command: mkdir “/bitnami/magento/Ie_connector”

Error: mkdir /bitnami/magento/Ie_connector: permission denied

submitted by /u/GillyV1king
[link] [comments]

dev enviroment: windows wsl2 ubuntu docker vs vmware player 17 ubuntu docker

Just a quick post as maybe you are setting up a dev enviroment for Magento 2, it always takes some time. To save someone the trouble here is my quick experience in a nutshell: use vmware player 17 ubuntu docker if you don’t want lagginess in Windows 11 and memory leaks: https://github.com/microsoft/WSL/issues/8725

For more details I compared both setups. For both I use https://github.com/markshust/docker-magento Magento 2 docker stuff. Using Windows was nice as I like having everything there like I already had phpstorm, my clipboard manager, chrome, etc. But Windows just uses up all the ram quickly and becomes laggy. I debated about going the vmware route but just do it, it doesn’t take that long to setup. I benchmarked a simple page request after clearing caches in Magento 2 and the performance is actually a little better (8%) in vmware docker than windows wsl2.

Vmware supports multiple monitors, and I noticed even that phpstorm takes a ton less ram in ubuntu for some reason. Another quick win tip if you do this. Xdebug you can lose some time if you don’t know what to use. Basically it seems when using docker usually what works is ping host.docker.internal and use that in your php.ini for the host. Mine is like this:

xdebug.mode = debug xdebug.client_port = 9003 xdebug.client_host = 192.168.1.67 xdebug.discover_client_host = true xdebug.idekey = PHPSTORM max_input_time = 0 max_execution_time = 0 

If anybody has any tips or their own experience in this regard please do share.

submitted by /u/kjavitz
[link] [comments]

Help: BOGO50 coupon

I’m trying to figure out how to set this up. I’ve got a category wherein anything in there is BOGO50. Buy any product in the category, get any product in the category 50% off (with the lowest of the two being discounted, naturally).

Any ideas? Buy X Get Y seems to only apply to identical products, which is definitely not what I need.

submitted by /u/BrainWav
[link] [comments]