Problem/Motivation

The formattable data items do not show up in LocalTaskItemForm, we have to show them as a text_format element.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

edurenye created an issue. See original summary.

edurenye’s picture

Status: Active » Needs review
StatusFileSize
new52.54 KB
new2.83 KB

Done, here you can see the result:

miro_dietiker’s picture

Status: Needs review » Needs work

That looks pretty well.

+++ b/translators/tmgmt_local/src/Form/LocalTaskItemForm.php
@@ -148,21 +147,41 @@ class LocalTaskItemForm extends ContentEntityForm {
+        elseif (!empty($data[$key]['#max_length'])) {
...
+          $form[$target_key]['translation']['#element_validate'] = ['::validateMaxLength'];

Is this really an else - so the max length is not validated if we have a format?
I would expect that both is possible at the same time.

miro_dietiker’s picture

Issue tags: +Needs tests

OK discussed, will be a followup to check source plugins and support both max length and format at the same time if needed.

Still we need test coverage to check consideration of format.

edurenye’s picture

Status: Needs work » Needs review
StatusFileSize
new1023 bytes
new3.83 KB

Added the tests, this should fail when adding a translation to the second data item without this fix, would be better to assert ussing class but we can not do that in simpletest until this issue is not finished #2469713: Step 2: Create a JavaScriptTestBase using PhantomJs Driver/Binary.

Should I add a @todo, I think is not necessary if the test_only fails, but not sure.

edurenye’s picture

Status: Needs review » Needs work

I'll make this test fail.

Created the followup #2654970: Check source length limits on formatted text fields.

edurenye’s picture

Status: Needs work » Needs review
StatusFileSize
new3.76 KB
new8.93 KB

That was completely wrong, so I fixed and added proper tests.
I'm not sure that now it's ok, because of the force option in the NestedArray::setValue in LocalTaskItem, but without I have some errors.
With this the tests pass and I tested manually and seems that everything is working fine.

The last submitted patch, 7: formattable_data_item-2654062-7-test_only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: formattable_data_item-2654062-7.patch, failed testing.

edurenye’s picture

Reverted the change in Data.

The last submitted patch, 10: formattable_data_item-2654062-10-test_only.patch, failed testing.

miro_dietiker’s picture

Status: Needs review » Fixed

Long live format support! Committed! :-)

  • miro_dietiker committed 1f80723 on 8.x-1.x authored by edurenye
    Issue #2654062 by edurenye, miro_dietiker: Formattable data item do not...

Status: Fixed » Closed (fixed)

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