Skip to content

[2.1.0] HTML minification problem with php tag with a comment and no space at the end #5316

@hostep

Description

@hostep

Steps to reproduce

  1. Install Magento 2.1.0 using composer
  2. Create a theme and a template file which contains this:
<?php //if ($showDescription):?>
    <div class="product description product-item-description">
        <?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
    </div>
<?php //endif; ?>
  1. Turn on html minification in the backend

Expected result

  1. Page is rendered properly without errors

Actual result

  1. Error message appears: Parse error: syntax error, unexpected '<'.

The minified php/html file was turned into:

<?php <div class="product description product-item-description"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?></div><?php ?>

Temporary solution

Add a space at the end and it works again, like this:

<?php //if ($showDescription): ?>

Metadata

Metadata

Labels

Area: FrontendEvent: kiev-cdFixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPartner: ISM eCompanyPull Request is created by partner ISM eCompanyReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions