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

PHP7 compatibility #17

Open
jglauche opened this issue Oct 8, 2016 · 1 comment
Open

PHP7 compatibility #17

jglauche opened this issue Oct 8, 2016 · 1 comment
Labels

Comments

@jglauche
Copy link

jglauche commented Oct 8, 2016

Hi,
I am running magento (very slightly fixed) in php7.

This problem arises when uploading images:

Uncaught Error: Function name must be a string in /var/www/shop/lib/Varien/File/Uploader.php:274

I thought it would be an easy fix by changing that line to
$params['object']->{$params['method']($this->_file['tmp_name'])};

But that would result in this error:

Uncaught Error: Call to undefined function validateUploadFile() in /var/www/shop/lib/Varien/File/Uploader.php:274

I believe it's looking at a wrong namespace. It wouldn't find it if I added a validateUploadFile function to that class.
I commented the line and it magically works.

Will there be a proper fix for that?

@nickw108 nickw108 added the bug label Oct 14, 2016
@ArturGoldyn
Copy link

That should rather be:
$params['object']->{$params['method']}($this->_file['tmp_name']);

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

No branches or pull requests

3 participants