Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated functionality: nl2br(): Passing null to parameter #1 #3790

Closed
addison74 opened this issue Feb 3, 2024 · 5 comments
Closed

Deprecated functionality: nl2br(): Passing null to parameter #1 #3790

addison74 opened this issue Feb 3, 2024 · 5 comments

Comments

@addison74
Copy link
Contributor

OpenMage 20.3 only
PHP 8.3
1 Category + 1 Configurable Product with 4 Simple Products.

This error appears in the system.log file when visiting the Configurable Product page.

2024-02-03T12:58:19+00:00 ERR (3): Deprecated functionality: nl2br(): 
Passing null to parameter #1 ($string) of type string is deprecated in 
/var/www/html/app/design/frontend/rwd/default/template/catalog/product/view/sharing.phtml on line 30

These are the lines 29 - 34

    <li>
        <?php $_u = 'p[url]=' . $_productUrl . '&p[images][0]=' . $_productImageUrl . '&p[title]=' . $_productName . '&p[summary]=' . urlencode(trim($_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description'))); ?>
        <a href="<?php echo 'http://www.facebook.com/sharer.php?s=100&' . $_u; ?>" target="_blank" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Share on Facebook')) ?>" class="link-facebook">
            <?php echo $this->__('Share Facebook') ?>
        </a>
    </li>
@sreichel
Copy link
Contributor

sreichel commented Feb 3, 2024

Duplicate of #3779

@addison74
Copy link
Contributor Author

addison74 commented Feb 3, 2024

This issue appears when the short_description and description fields are changed in the attribute page and are no longer required to contain anything. When I filled in short_description with a character, the error no longer appears.

Most likely due to the fact that these two attributes were set up as mandatory from the very beginning, Magento Team did not take into account that they could be empty.

@sreichel
Copy link
Contributor

sreichel commented Feb 3, 2024

Off-topic: that why it seem wrong to me to advertise php8.1+ support ... with still having a lot of issues,

... and we need unit tests ... ;)

@sreichel
Copy link
Contributor

sreichel commented Feb 3, 2024

@addison74

To reproduce

  • make short_description optinal
  • create new product
  • leave short description empty (null in db)
  • ...

@addison74
Copy link
Contributor Author

Off-topic: that why it seem wrong to me to advertise php8.1+ support ... with still having a lot of issues,

... and we need unit tests ... ;)

If we had more testers using DDEV we could carefully check the latest PHP 8.x versions for every branch . One should keep an eye on the log files and patiently load the Frontend/Backend from the sample package in all sections. I'm still using PHP 7.4 in production, which is maintained by the Debian team. The fact that it has been EOL for some time does not push me to replace it with 8.2 or 8.3 from Sury.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants