Problem/Motivation

Fields that have #type text_format have a nested value key.

Proposed resolution

Add a test that displays a text with format and save back the form.

Remaining tasks

User interface changes

API changes

Comments

sasanikolic’s picture

miro_dietiker’s picture

Priority: Normal » Major
Status: Active » Closed (duplicate)

This is not only major, but the other issue is broken. So this needs to happen as part of the other issue.

berdir’s picture

Status: Closed (duplicate) » Active

The problem exists in HEAD, so separate issue makes sense :)

+1 on major.

miro_dietiker’s picture

Also note that the HTML validation is broken with text format... Dunno if this needs a separate issue.

sasanikolic’s picture

sasanikolic’s picture

Status: Active » Needs review
StatusFileSize
new1.95 KB

Expanded the test for nested arrays.

Also we found out that we get lots of errors when the translator does not have the correct permissions. Check #1415234: Deal with text format permissions and security.

Status: Needs review » Needs work

The last submitted patch, 6: expanding_tests_for-2472303-6.patch, failed testing.

berdir’s picture

+++ b/src/Tests/TMGMTUiTest.php
@@ -425,20 +425,30 @@ class TMGMTUiTest extends TMGMTTestBase {
-    \Drupal::state()->set('tmgmt.test_source_data', array(
+    $nested_array = \Drupal::state()->set('tmgmt.test_source_data', array(

set() has no return value.

Now we need to actually fix this, with the fix from interdiff in the other issue, but in a way that it doesn't break non-formatted texts.

berdir’s picture

And the test also needs to verify that we store the translation correctly.

sasanikolic’s picture

Status: Needs work » Needs review
StatusFileSize
new2.78 KB
new1.98 KB

Added the check for the translated text and fixed the issue.

miro_dietiker’s picture

OK i see we have now a test that takes care of nested things in the dummy source and test translator.

I fear the fact that we don't have a web test with real nodes with both cases of unformatted and formatted (wysiwyg) fields going through the whole chain. Do we have?

sasanikolic’s picture

Changed the test and made sure that we correctly assert the translated text.

sasanikolic’s picture

The node test didn't set a format, so we didn't have any existing tests that were using text formats and saving translations. This should fix it.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good now.

miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.