[solved] import function, undefined function zlib_encode

More
11 years 7 months ago #47873 by tonnick
hello !

sorry to insist, but I would need to make work the import function. And unfortunatly, I found no way to install this function on the server.

it is based on zlib library which is already installed :/

So is there a quick way to disable temporary this function in flexicontent ? thx !

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #47900 by tonnick
sorry to insist once again, but, how can I desactivate this function in flexi code ?
the upgrade is impacting the production :(

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #47911 by ggppdk
hello,
busy and been sick these days

test this fix, that detects PHP version (so that you do not to wait for this to be tested/commited):

1. in files:
administrator\components\com_flexicontent\controllers\import.php(117)
administrator\components\com_flexicontent\controllers\import.raw.php(48)
administrator\components\com_flexicontent\views\import\view.html.php(71)

replace:
Code:
$conf = unserialize( $conf ? zlib_decode(base64_decode($conf)) : "" );
with
Code:
$has_zlib = version_compare(PHP_VERSION, '5.4.0', '>='); $conf = unserialize( $conf ? ($has_zlib ? zlib_decode(base64_decode($conf)) : base64_decode($conf)) : "" );




2. in file:
administrator\components\com_flexicontent\controllers\import.php

replace:
Code:
$conf = base64_encode(zlib_encode(serialize(null), -15));
with:
Code:
$has_zlib = version_compare(PHP_VERSION, '5.4.0', '>='); $conf = $has_zlib ? base64_encode(zlib_encode(serialize(null), -15)) : base64_encode(serialize(null));

and replace:
Code:
$session->set('csvimport_config', base64_encode(zlib_encode(serialize($conf), -15)), 'flexicontent');
with:
Code:
$has_zlib = version_compare(PHP_VERSION, '5.4.0', '>='); $session->set('csvimport_config', ( $has_zlib ? base64_encode(zlib_encode(serialize($conf), -15)) : base64_encode(serialize($conf)) ), 'flexicontent');


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #47922 by tonnick
ok it seems to be ok ! thx for you help and get well !

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #47925 by ggppdk
Hello

ok, thanks for feedback

commited this fix


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save