Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

MO: Fix Php Warning: Round() Expects Parameter 2 To Be Long #26

Merged
merged 1 commit into from
Aug 16, 2016

Conversation

firstred
Copy link
Contributor

Solves Php Warning: Round() Expects Parameter 2 To Be Long because _PS_PRICE_COMPUTE_PRECISION_ isn't defined on all versions of PrestaShop.

Defaults to 0 if _PS_PRICE_COMPUTE_PRECISION_ is not defined.

Also converted to PSR-2 + PHPDoc comments

$this->getCacheId('socialsharing_he ader|'.
(isset($product->id) && $product->id ? (int)$product->id : '')))
) {
if (!defined('_PS_PRICE_COMPUTE_PRECISION_')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_PS_PRICE_COMPUTE_PRECISION_ is not defined on PS versions < 1.6.0.11

Copy link
Contributor

@mickaelandrieu mickaelandrieu Apr 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... but if shops are updated to 1.6.1.5, this constant is defined so ... we dont need to do a check.

The only - and very good - solution is to update version of PrestaShop in concerned websites, right ?

To be more explicit: why a majority should accept a patch for a few that dont want to upgrade/update their version of PrestaShop ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, release early, release often, totally agree! But don't forget that these modules are also pushed to older versions.

I'm afraid we also can't ignore the the devs who are forced to make their modules compatible with older versions :)
This is the first thing I see (with xdebug) whenever I fire up a new instance of the first stable 1.6 version:
1605socialsharin

Would be worth spilling a few CPU cycles on newer PS versions, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's go for it!

👍

@firstred firstred changed the title [-] MO : Fix Php Warning: Round() Expects Parameter 2 To Be Long MO: Fix Php Warning: Round() Expects Parameter 2 To Be Long Aug 16, 2016
@firstred
Copy link
Contributor Author

Rebased and changed into an atomic commit ( was huge 😮 )
@mickaelandrieu Still going for it? 😜
ping @Shudrum @maximebiloe @julienbourdeau @vincentbz @xBorderie

@mickaelandrieu
Copy link
Contributor

LGTM, thanks!

@mickaelandrieu mickaelandrieu merged commit 7529960 into PrestaShop:dev Aug 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants