Closed damianz5 closed 6 years ago
Seems weird... the correct language used to serialize the attributes is used in https://github.com/kaliop-uk/ezmigrationbundle/blob/master/Core/Executor/ContentManager.php#L559
I will investigate a bit more
Tested with ezplatform 210:
php bin/console ka:mig:gen AppBundle --format=yml --type=content --match-type=content_type --match-value=testct --mode=create --lang=fre-FR
got correct results:
-
type: content
mode: create
content_type: testct
parent_location: 2
priority: 0
is_hidden: false
sort_field: name
sort_order: ASC
remote_id: 73cdfd20849fad9786bdfeaa988a50ce
location_remote_id: 7773bd50d64fe204a6aa463ca1d93df1
lang: fre-FR
section: 1
owner: 14
modification_date: 1532131229
publication_date: 1532131132
always_available: false
attributes:
title: 'Test (french)'
tags: { }
Same when I created a content directly in french:
-
type: content
mode: create
content_type: testct
parent_location: 2
priority: 0
is_hidden: false
sort_field: name
sort_order: ASC
remote_id: 175fc559bcf0ba5abea16b126d554acf
location_remote_id: 41129a0ea2ad97183749d880f5b6c100
lang: fre-FR
section: 1
owner: 14
modification_date: 1532131898
publication_date: 1532131898
always_available: false
attributes:
title: 'Test2 (french only)'
tags: { }
In other words: can not reproduce :-(
OK, so maybe I misunderstood what you were asking for. Maybe you meant that, in case the language parameter is passed as command line option, the 'generate' command should not generate creation yml for contents that are not translated in that language ?
If so, I think that this topic could be expanded a bit, taking into consideration:
Ping. Any feedback ?
2nd ping. Will close in 1 month if still open...
could you describe what was the exact steps for 'added new language: french (fre-FR)'? it was added by AdminUI or/and ezplatform.yml?
It works for me for ezplatform repo / master branch as you described, but not for ezplatform-demo repo / master... configuration looks the same in both cases https://github.com/ezsystems/ezplatform-demo/blob/master/app/config/ezplatform.yml#L74 Do you see what may be the issue here?
I've just noticed that there is ^4.0 on ezplatform-demo for this bundle - changing it to ^5.0 fix the issue. Thank you for retest, issue can be closed.
[Ezplatform demo] - after adding a new language to blog_post, I've tried to generate a migration using command:
the result file was generated with proper
lang: fre-FR
but attributes was emptyattributes: { }
workaround is to replace this line https://github.com/kaliop-uk/ezmigrationbundle/blob/master/Core/Matcher/ContentMatcher.php#L101
with:
the language code parameter (
--lang=
) should be passed to findContent method