Problem/Motivation

Trying to set header (Plural-Forms specifically) from a current PO header using PoHeader::setFromString but the key returned for Plural-Forms is "\"Plural-Forms" (with the extra double quote).

Steps to reproduce

Create a new PoHeader.

$header1 = new PoHeader();
$header2 = new PoHeader();
$header2->setFromString($header1);

$header2 Plural-Forms is not properly set.

Proposed resolution

Fix the parseHeader function.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

duncancm created an issue. See original summary.

duncancm’s picture

cilefen’s picture

Status: Active » Needs review
gauravvvv’s picture

StatusFileSize
new601 bytes
new625 bytes

Re-rolled the patch, attached interdiff for same

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

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

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.

mstrelan’s picture

Version: 9.4.x-dev » 10.1.x-dev
Status: Needs review » Needs work
Issue tags: +Bug Smash Initiative, +Needs tests

Can we get a failing test for this? Possibly we can add something to \Drupal\Tests\Component\Gettext\PoHeaderTest.

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.