kaliop-uk / ezmigrationbundle

This bundle makes it easy to handle eZPlatform / eZPublish5 content upgrades/migrations
GNU General Public License v2.0
53 stars 81 forks source link

Content update with `and` and `attribute` #223

Closed Codein-Alex closed 3 years ago

Codein-Alex commented 4 years ago

I have the following update statement.

-
    type: content
    mode: update
    match:
        and:
            -
                location_id: 167
            -
                content_type_identifier: plan
            -
                attribute:
                    name:
                        eq: Alex
    attributes:
        tag: Alex

Says content has been updated.

But it does not.

If I remove attribute part.

            -
                attribute:
                    name:
                        eq: Alex

It does work! content 'Alex' has been updated

My name field is an ezstring.

Nom | name | ezstring

I noticed that when it says that content has been updated, name does not appear like KM did not find any content.

What is wrong with the statement?

versions : * 5.10.1
gggeek commented 3 years ago

Sorry for taking so long to respond.

I think that the problem might come from the fact that you are not running the migration with the correct language setting (and have not set up fre-FR as the default content language for your db).

Here is a simple test migration that does work on my setups, which looks exactly your scenario:

-
    type: content
    mode: load
    match:
        and:
            -
                location_id: 51
            -
                content_type_identifier: folder
            -
                attribute:
                    name:
                        eq: Images
    #expect: one
    references:
        -   identifier: matched
            attribute: count
        -   identifier: ct
            attribute: content_type_identifier

-
    type: reference
    mode: dump
    identifier: reference:matched
-
    type: reference
    mode: dump
    identifier: reference:ct
Codein-Alex commented 3 years ago

I switch the approach to do it another way. Thank you for your time, you are probably right about language.

We can close this as I am not going to work soon on the project.

Alex