Hello,

I don't know how to solve this, but I thought it could be usefull to report the bug

here is the situation :
Long text field
html default value + full html format activated
Multiple value allowed

When I create the content, the default html value is here, but if I add another item, the default value seems to be forgotten for the new item..

Regards
-p-

CommentFileSizeAuthor
#20 2023-07-31_18-38.png16.02 KBnlisgo

Issue fork drupal-1285638

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Version: 7.8 » 8.x-dev
Priority: Major » Normal
Issue tags: +Needs tests, +Needs backport to D7

Fixing status a bit, seems like we don't have automated test coverage for that so adding tag.

pacome’s picture

Title: on Long Text/Mutliple value, html default value doesn't appear in new items » on Long Text/Multiple value, html default value doesn't appear in new items
pacome’s picture

It doesn't solve the issue, but I could get around the problem by inserting the text-field (multiple value not allowed) in a dedicated fieldcollection with multiple value allowed...

It seems to work like it should :)

++
p.

mkarras’s picture

Assigned: Unassigned » mkarras

I'm writing tests as part of Drupal Office Hours.

mkarras’s picture

Assigned: mkarras » Unassigned

Verified that this is still an issue for the case as described in the initial bug report.
When you click 'add another item' on a multiple value long text field, the default value does not flow to that item when it is created.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Version: 8.9.x-dev » 9.3.x-dev
Issue summary: View changes
Issue tags: +Bug Smash Initiative

Tested on Drupal 9.3.x and there is something unexpected in the way default values for multivalued long text field behaves. I set the field to unlimited and set a default value in the first and third entries. Then, when adding content the default value for the first entry was correct but the default value for the third entry appeared in the second entry.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nlisgo made their first commit to this issue’s fork.

nlisgo’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)
FileSize
16.02 KB

It is my understanding that the expected behaviour is different from what is described in the issue summary.

When you have a multi value field and you choose a default value then the first entry for the default value is for the first item and you can create subsequent default values:

The html field is broken because you cannot supply multiple values for it.

The behaviour in #14 is also expected beahviour. When you have a multi value you field then empty fields are ignored so you would find that if you returned to the interface for the default value that the second empty entry has been removed.

The bug I am experiencing is that I can not seem to set a second (or third and so on) default value for formatted text fields.

I am going to close this ticket as working as expected and open another issue to document the bug that I am experiencing which triggers the following error:

Error: Cannot use object of type Drupal\Core\StringTranslation\TranslatableMarkup as array in Drupal\text\Plugin\Field\FieldType\TextFieldItemList->defaultValuesFormValidate() (line 24 of /data/app/core/modules/text/src/Plugin/Field/FieldType/TextFieldItemList.php).

Update on the follow referenced above. I think it was an error with my setup. If I see it again and I'm confident I can surface steps to reproduce I will open an issue.