uicomponent: the filter in the custom grid does not work normally. Magento2

When I filter twice, it works well after the third time, only one product is shown in each row.

grid_record_grid_list.xml

    

    
        
            grid_record_grid_list.grid_record_grid_list_data_source
            grid_record_grid_list.grid_record_grid_list_data_source
        
        grid_records_columns
        
            
                Add
                Add new row
                primary
                * / * / add row
            
        
    
    
        
            Magento  Framework  View  Element  UiComponent  DataProvider  DataProvider
            grid_record_grid_list_data_source
            Article ID
            Article ID
            
                
                    
                
            
        
        
            
                Magento_Ui / js / grid / provider
            
        
    
    
        
            
                ui / grid / toolbar
                ui / grid / sticky / toolbar
            
        
        
        
        
            
                
                    grid_record_grid_list.grid_record_grid_list.grid_records_columns
                    
                        grid_record_grid_list.grid_record_grid_list.listing_top.bookmarks
                        current filters
                    
                    
                        
                            
                                Magento_Ui / js / form / element / ui-select
                                ui / grid / filters / elements / ui-select
                            
                        
                    
                    
                        grid_record_grid_list.grid_record_grid_list.listing_top.listing_filters
                        
                            grid_record_grid_list.grid_record_grid_list.grid_records_columns. $ {$ .index}: visible
                        
                    
                
                
                    column
                
            
        
        
            
                
                    grid_record_grid_list.grid_record_grid_list.grid_records_columns.ids
                    Magento_Ui / js / grid / tree-massactions
                    I.D
                
            
            
            
                
                    
                        delete
                        Delete
                        
                        
                            Delete
                            Do you want to delete the record of the selected row?
                        
                    
                
            
            
                
                    
                        Edited
                        grid_record_grid_list.grid_record_grid_list.grid_records_columns_editor
                    
                    Edit
                    
                
            
        
        
            
                
                    
                        grid_record_grid_list.grid_record_grid_list.listing_top.bookmarks
                        current.paging
                    
                    grid_record_grid_list.grid_record_grid_list.grid_records_columns.ids
                
            
        
    
    
        
            
                
                    
                    false
                
                entity_id
                true
                grid_record_grid_list.grid_record_grid_list.grid_records_columns.ids
            
            
                
                    grid_record_grid_list.grid_record_grid_list.grid_records_columns_editor
                    home edit
                    
                        $ {$. $ data.rowIndex}
                        true
                    
                
            
        
        
            
                
                    entity_id
                    desc
                    0
                
            
        
        
            
                
                    text
                    Article ID
                
            
            
                
                    
                        true
                    
                    text
                
            
        
        
            
                
                    text
                    Quantity
                
            
            
                
                    
                        true
                    
                    text
                
            
        
        
        
            
                
                    false
                    107
                    entity_id
                
            
        
    

Before the filter
enter the description of the image here

After the filter
enter the description of the image here

Thanks for the answers

magento2 – Convert Object to Array

I try to convert my custom object to Array.

Here my object:

Namespace  Project  Model  Customized  Object object
(
    [attr1:protected] => value1
    [attr2:protected] => value2
    [attr3:protected] => value3
)

Here, my code to convert:

Protected function objectToArray ($ object)
{
if (! is_object ($ object) &&! is_array ($ object)) {
returns $ object;
}
returns array_map (array ($ this, "objectToArray"), (array) $ object);
}

But the result is:

Training
(
    [ * attr1] => value1
    [ * attr2] => value2
    [ * attr2] => value3
)

I do not understand why * appears in my matrix key … Any suggestions to remove them? If possible, when I create the matrix, not later.

magento2: missing Magento 2 thumbnails in store view (language)

I am using Magento 2.3.1. We have 3 store views for several languages. A store view (German language) does not display the category thumbnails correctly. The other does not have any problem. We try to reindex, rebuild static content, clear cache. In the product pages, the images are fine, the problem is only in the category pages. Any ideas?

Magento2 Security: How to better filter the GET parameters before they reach Magento?

I want to increase the security of one of our Magento2 installations by filtering the GET parameters. It seems that, according to our WAF, we often try to exploit the "filter" parameters; for example:

/sweets/candies/natural-flavours.html?product_filter_tryout=1133%25%27%20UNION%20ALL%20SELECT%20NULL%2CNULL%23

This happens, it does not matter if the filters are used on the website or not. Therefore I want to block all requests to ? product_filter_tryout *, or better white list all parameters actually used on the site (such as ? p = * etc.). How I can get this?

magento2: add custom attributes when creating a product through the REST API

I'm trying to set custom attributes when creating a new product through the REST API. The products have a required attribute. hpuuid. This is part of my JSON file to create the new product:

{
"product": {
"sku": "12345",

... Quite a few fields here ...

"custom_attributes": [
            {
                "attribute_code": "hpUuid",
                "value": "123"
            }
        ],
}
}

When sending, the REST API returns this error:

{"message": "The attribute value " hpUuid  "is empty. Configure the attribute and try again."}

The fine docs suggests that the format is correct, but Why can not he read the value??

magento2 – Custom product attribute in Magento 2 observer

Someone knows how to obtain the custom attribute of the product in the observer:

My current code is giving me:

Error not detected: call a member function getProduct () null in


$ product = $ this-> productRepository-> getById ($ observer-> getItem () -> getProduct () -> getId ());
$ attr = $ product-> getData (& # 39; product_customattribute & # 39;);

I also tried this (same error):

    $ product = $ observer-> getEvent () -> getProduct ();
$ attr = $ product-> getProduct () -> getAttributeText (& # 39; product_customattribute & # 39;);

magento2 – Cancel file / pub / media / … css?

I would like to cancel a CSS file that is here:

/pub/media/porto/web/css/header/type6.css

But when I try to put it on my son's subject, nothing happens:

/ app / design / frontend / Smartwave / porto_child / ...

So, my question is: Is it possible to override the css files located in pub / media? And if so, how can I do it?

Thank you all for your attention.

magento2 – Magento 2 – Rule of purchase – Buy X and get a free gift

Is there any form or extension to establish the rules of the cart there?

  • Rule 1: buy X> 50 – get a free gift A
  • Rule 2: buy Y> 100 – get a free gift B

If the order is made with Y> 100 Y X> 50

  • Just get the free gift B (not both)

And the other car rules (if any) are still maintained.

Magento2.2 – Magento2 minus modification command

It could be this basic query.
I am using "Pedona magento theme" for my website, now I need a small modification in the style.

/app/design/frontend/pedona/pedona_default/web/css/style.less

Should you execute a command or will it automatically compose in style.css?

Magento2 +

magento2 – Interactive with the step of sending from the personalized step

This is my first time with payment step. I created a time step function in a custom step that will save an address in the database in a custom address entity when the user navigates to the submit step. However, in the database, the new record was added to the table by an ajax call but was not shown in the html address renderer. Since I can see the correct result when I go back to the payment process, I guess the result is initial in the first step when the user enters the payment process. My question is "Is there any way to update that html or the data: Elem in that html?"