When #2289063: Change contact message entity to behave more like a normal entity was done, it missed adding the langcode. This has caused an issue in the contrib Contact Storage module. On Berdir's suggestion, I added the langcode to the Message class as per this change record. This fixes the issue in Contact Storage.
The ContactForm entity doesn't have a langcode, either, but I am not clear if it is supposed to so did not add one. I can add one if that should have one, too.
| Comment | File | Size | Author |
|---|---|---|---|
| #57 | interdiff_55-57.txt | 666 bytes | shivam-kumar |
| #57 | 2484959-57.patch | 6.11 KB | shivam-kumar |
| #55 | interdiff_49_55.txt | 4.81 KB | ameymudras |
| #55 | 2484959-55.patch | 6.02 KB | ameymudras |
| #51 | reroll_diff_43-49.txt | 7.54 KB | Ankit.Gupta |
Comments
Comment #1
michelleHere is the patch.
Comment #2
michelleTotally forgot to set this needs review. Doh!
Comment #3
damienmckennaWould tests be needed to clarify the problem?
Comment #4
andypostOn one hand "messsage" is a content entity but without storage
Otoh
\Drupal\contact\Controller\ContactController::contactSitePage()should properly pass language to message form cunstructorand after changing
\Drupal\contact\MailHandler::sendMailMessageswe can pass language to message builder$recipient_langcode = $this->languageManager->getDefaultLanguage()->getId();currently worksmakes sense
Comment #5
andypostComment #7
berdir#2533964: Langcode widget visibility settings from language.module are not applied consistently also adds the langcode key, but doesn't contain the other fixes. Will conflict with that.
Comment #8
andypostFailed tests are shows that usage of message language somehow broken
Comment #9
gábor hojtsyLet's at least get #2533964: Langcode widget visibility settings from language.module are not applied consistently in soon so this needs to fix less :)
Comment #10
gábor hojtsyLet's get #2533964: Langcode widget visibility settings from language.module are not applied consistently in first.
Comment #11
michelleSince that other issue contains what was my original patch here, should I reroll this one so it just has Andy's code and take out mine? Which is kind of a bummer since I was hoping this would be my first core patch but I guess that's how it goes. LOL!
Comment #12
gábor hojtsy@Michelle: you will definitely still be mentioned in the commit credits once/if this lands. So while the actual lines you wrote may not land, you will get the credit. I would say you should wait until #2533964: Langcode widget visibility settings from language.module are not applied consistently lands, which is why I marked this postponed, so that there is no duplication of work.
Comment #13
michelleI meant it would be the first time a patch I wrote got into core so doesn't really count if the patch goes in without my code. LOL! It's ok. I'll just have to try again. :)
Ok, I'll wait on this, then, thanks.
Comment #14
andypost@Michelle my patch was just a test to make sure that contact is broken with passed language, actually I came here by reviewing current contact module issues after #2223967: Do not decode a contact message twice
I think the issue shows regression that mostly caused by that we used contact in 8.x dev as a playground for multilingual abilities of i18n
Comment #15
andypostAs #2533964: Langcode widget visibility settings from language.module are not applied consistently commited
this issue better re-focus on passing language to mail handler properly (#5) and add tests
Comment #16
andypostre-scope and re-roll, cos langcode is here
Comment #18
andypostComment #21
andypostThere's a contrib that depends on it #2796335: Fix hard coded language on URL alias
Comment #22
oleksiyAdded tests, but not sure if implementation is correct... Please, check
Comment #25
oleksiyReroll
Comment #26
andypostComment #27
andypostTests already added
Comment #39
larowlanComment #40
ravi.shankar commentedAdded reroll of patch #25 on Drupal 9.4.x.
Comment #41
michelleSetting to "needs review" to see if the reroll passes tests, which is why it was at "needs work" before.
Comment #43
shubham chandra commentedAdded reroll of patch #25 on Drupal 9.5.x.
Comment #44
ameymudras commentedFixing the issue
Error: Call to undefined method Drupal\Tests\contact\Unit\MailHandlerTest::getMock()in the testsComment #48
amber himes matzTests showing this failure:
Comment #49
Ankit.Gupta commentedReroll the patch #43 with Drupal 10.1.x
Comment #50
ameymudras commentedThanks @Ankit, I see a few coding standard issues in the patch #49
Also could you please provide an interdiff which will make it easy to review your code.
Comment #51
Ankit.Gupta commentedInterdiff file attached .
Comment #52
ravi.shankar commentedLooks like there are some extra changes are there in patch #49, as there is around a 4kb difference in both patches.
Comment #53
kristen polThanks for the interdiff. I have not reviewed for accuracy/readability. I was just scanning and noticed some minor formatting things:
Curly bracket needs to move back up
Extraneous space on blank line
Curly bracket needs to move back up
Curly bracket needs to move back up
Curly bracket needs to move back up
Curly bracket needs to move back up
Curly bracket needs to move back up
Curly bracket needs to move back up
Curly bracket needs to move back up
Curly bracket needs to move back up
Extraneous space on blank line
Blank line shouldn't be removed
Comment #54
kristen polAh... these are all in the CI failure except for the extraneous spaces:
https://www.drupal.org/pift-ci-job/2497667
Comment #55
ameymudras commentedFixed the coding standard issues and also tried to fix the other CI issues
Comment #57
shivam-kumar commentedFixed 2nd Fail of #55
Comment #59
quietone commentedThe Contact Module was approved for removal in #3476879: [Policy] Move Contact module to contrib.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3520460: [meta] Tasks to deprecate the Contact module and the removal work in #3520466: [meta] Tasks to remove Contact module.
Contact will be moved to a contributed project after the Drupal 12.x branch is open.
Comment #61
andypost