Problem/Motivation

Drupal 7 has three connectors: drupal.org releases parsed with potx, local Drupal packages parsed with potx (file system and upload sources), and uploaded gettext files. On 3.0.x only the first works. The drupal:filesystem and drupal:upload plugins exist with their settings forms, but their scan and parse handlers return random numbers. The local connector is what every Drupal 7 test runs on and what a developer needs to feed a test site without drupal.org.

Proposed resolution

Implement the file system source on the shared parser from #3582331: Refactor ParserService potx string discovery. Scan: find *.tar.gz under the configured directory, a subdirectory name is the project title, the file name holds the project uri and the version, record the project (with the drupal.org home link when configured) and the release with the path and the file date, mark a release unparsed again when its file date changes, skip names without a version and projects owned by another connector, like Drupal 7. Parse: unpack the package through the shared archive loader, run the potx tree parser and the entity writer, remove the tree. Without a release set, the connector picks the release of its projects parsed longest ago, like Drupal 7.

Along the way: PotxTreeParser and a new ArchiveTreeLoader live in l10n_server so both connectors share them, the archive loader quotes paths for the shell and checks the tar exit code, and parsed trees and downloaded archives are deleted afterwards.

Tests: Drupal 7 L10nDrupalFilesTestCase::testLocalFilesScan() first (found one PHP 8 warning in the Drupal 7 version detection for names without a version, guarded), the port DrupalFileSystemConnectorTest scans and parses the potx test package with the counts from its report, rescans, and checks the skip cases. The upload source and the gettext connector are separate issues.

LLM disclosure

LLM was used to find, diagnose explain and fix this issue. With human review.

Comments

gábor hojtsy created an issue. See original summary.

  • d262410f committed on 3.0.x
    fix #3621536: Drupal packages connector for the local file system is a...

  • a94b644f committed on 7.x-1.x
    fix #3621536: Drupal packages connector for the local file system is a...
gábor hojtsy’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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