craftcms / craftcms/cms

[4.x]: translationMethod setting from MatrixBlockTypes not applied when using project-config/apply command

Open
#13,836 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft4
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

I believe I found this bug when trying to make a field inside a matrix block translatable for each site.

I tried making a simple plain text field translatable for each site in my local environment. This worked and the project config file were update to translationMethod: site inside the matrixBlockTypes config files, along the the dateModified project.yaml

So I deployed this and noticed the fields weren't translatable on the dev and production environment using the ./craft migrate/all and ./craft project-config/apply commands.

For some reason the translationMethod: site setting from the config files is not being applied.

Steps to reproduce
  1. Created clean install on local machine.
  2. Create an extra site
  3. Create simple matrix field with for example titleField and textField (not translatable yet)
  4. Update config/project/matrixBlockTypes/****yaml file and set translationMethod to site.
  5. Update dateModified in project.yaml
  6. Use ./craft project-config/apply command.
Expected behavior

You expect that the fields translationMethod setting changes to for each site.

Actual behavior

The fields translationMethod does not change add all. When you save the field again the config file gets updated to translationMethod: none again.

Craft CMS version

4.5.6.1

PHP version

8.0

Operating system and version

Mac os 13.4 (22F66)

Database type and version

mysql

Image driver and version

No response

Installed plugins and versions

"require": {
"craftcms/cms": "^4.4.0",
"craftcms/redactor": "^3.0",
"vlucas/phpdotenv": "^5.4.0"
},
"require-dev": {
"craftcms/generator": "^1.3.0",
"yiisoft/yii2-shell": "^2.0.3"
},

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the described matrixBlockTypes configuration and the project-config/apply command. Trace how the command reads the matrix block type configuration and applies translationMethod; done means site-level translation is applied and remains site after the field is saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.