Skip to content

Incorrect POT license info for themes without a license in the header #398

@meszarosrob

Description

@meszarosrob

Bug Report

Describe the current, buggy behavior

If in a Theme Header (style.css) the License is not added, when I generate the POT file, I see the This file is distributed under the .

"Copyright (C) %1\$s %2\$s\nThis file is distributed under the %3\$s.",

Describe how other contributors can replicate this bug

Scenario: Wrong license information is displayed for the theme
  Given an empty foo-theme directory
  And a foo-theme/style.css file:
    """
    /*
    Theme Name: Foo Theme
    */
    """

  When I run `wp i18n make-pot foo-theme foo-theme.pot`
  Then the foo-theme.pot file should contain:
    """
    # This file is distributed under the .
    """

Describe what you would expect as the correct outcome

To see the This file is distributed under the same license as the X theme.

"Copyright (C) %1\$s %2\$s\nThis file is distributed under the same license as the %3\$s theme.",

Let us know what environment you are running this on

OS:     Linux 6.5.0-10027-tuxedo
Shell:  
PHP binary:     /usr/bin/php8.0
PHP version:    8.0.30
php.ini used:   /etc/php/8.0/cli/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 15.1 Distrib 10.5.21-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper
SQL modes:      STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /var/www/html
WP-CLI packages dir:    
WP-CLI cache dir:       /home/user/.wp-cli/cache
WP-CLI global config:   
WP-CLI project config:  /var/www/html/wp-cli.yml
WP-CLI version: 2.9.0

Provide additional context/Screenshots

There was PR that fixed this for the plugins #199

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions