Problem
Drupal 7 deletes the warnings of a release before it records the warnings of a new parse, so a release parsed again (a changed local package, or a start over) shows the warnings of the last parse only. On 3.0.x the entity writer only inserts, so every parse adds the same warnings again.
The shared string check of 3.0.x refuses source strings over 6500 bytes with the message that they should be shorter than 64k characters. The Drupal 7 drupal.org connector refused them over 65000 bytes, the limit of the text column; the Drupal 7 local packages connector did not check the length at all.
The warning text also always reads "At in on line . Read more at " when potx gives no file, line, excerpt or link, and potx's own message goes through a second round of escaping, so the placeholder markup of potx ends up as literal text on the warnings page (Drupal 7 rendered it as markup).
Proposed resolution
- The entity writer drops the warnings of the release before writing the new ones.
- The limit is 65000 bytes, like Drupal 7 and the text column.
- The warnings are stored the way Drupal 7 stored them, so the migrated ones and the new ones look alike: the message of potx with its placeholder markup, then "In %file on line %line." (or with the excerpt) and "Read more at" with a link, only the parts potx gave. A field formatter shows them as admin-filtered markup on the warnings listings and the release page, like Drupal 7 did. The rest connector's report fixtures are regenerated accordingly.
Tests
Drupal 7 first: testReparseWarnings() of the local files test packages a module with an empty string and a 7000 byte string, parses it, then parses the changed package again and checks that the warning and the strings are not doubled (potx keeps its messages within one request, the test clears them between the two runs like separate cron runs would). Ported into DrupalFileSystemConnectorTest, which also checks that a 70000 byte string is refused with a warning and that the warning names the file and line.
LLM disclosure
LLM was used to find, diagnose explain and fix this issue. With human review.
Comments
Comment #4
gábor hojtsy