Skip to content

Fix string extraction from block.json - #253

Merged
swissspidy merged 1 commit into
wp-cli:masterfrom
dlind1:fix-block-extraction
Jun 10, 2021
Merged

Fix string extraction from block.json#253
swissspidy merged 1 commit into
wp-cli:masterfrom
dlind1:fix-block-extraction

Conversation

@dlind1

@dlind1 dlind1 commented Jun 9, 2021

Copy link
Copy Markdown
Contributor

The current logic in BlockExtractor stops processing the block.json file when --ignore-domain is present, but the json file contains non-empty "textdomain" property. This PR adjusts the check to make sure that the strings are always extracted when --ignore-domain is set, regardless of the textdomain presence or value. The possible flows can be summarized as:

  1. --ignore-domain is set - always extract the strings.
  2. --domain=<value> is present and block.json has no textdomain or has "textdomain":null- extract the strings.
  3. --domain=<value> is present and block.json has matching textdomain value - extract the strings.
  4. --domain=<value> is present and block.json has no matching textdomain value - ignore the file.

Fixes #252

@swissspidy
swissspidy merged commit 2141324 into wp-cli:master Jun 10, 2021
@schlessera schlessera added this to the 2.2.9 milestone Jul 5, 2021
schlessera pushed a commit that referenced this pull request Jan 6, 2022
Fix string extraction from block.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants